Friday 31 May 2024

Clean Centos

cat /etc/centos-release
rm -rf y /usr/local/WowzaStreamingEngine-4.5.0/logs/*
free -m
sync; echo 1 > /proc/sys/vm/drop_caches
sync; echo 2 > /proc/sys/vm/drop_caches
sync; echo 3 > /proc/sys/vm/drop_caches
rm -rf /var/cache/yum
rm -rf /var/tmp/yum-*

df -h
yum clean all
yum autoremove
yum autoclean all

yum clean all
yum autoremove
rm -rf /var/cache/yum
rm -rf /var/tmp/yum-*
yum update
yum upgrade


Perintah berikut hanya membuat 2 kernel terbaru tetap terinstal.
package-cleanup --oldkernels --count=2
=============
package-cleanup --quiet --leaves --exclude-bin
package-cleanup --quiet --leaves --exclude-bin | xargs yum remove -y
rm -rf /root/.npm /home/*/.npm /root/.node-gyp /home/*/.node-gyp /tmp/npm-*
rm -rf /root/.composer/cache
rm-rf /home/*/.composer/cache
find -regex ".*/core\.[0-9]+$" -delete
rm -rf /root/.composer/cache
rm-rf /home/*/.composer/cache
find -regex ".*/core\.[0-9]+$" -delete
# Bersihkan semua file yang ada di tong sampah
rm -rf /home/*/.local/share/Trash/*/**
rm -rf /root/.local/share/Trash/*/*
# Hapus semua log yang sudah lama dan sudah di archive
find /var/log -type f -regex ".*\.gz$" | xargs rm -Rf
find /var/log -type f -regex ".*\.[0-9]$" | xargs rm -Rf
===============================================================
          
java -version
sudo alternatives --config java
sudo alternatives --config java
/etc/XXX.yum.repos.d/2024

No comments:

Post a Comment