Fedora28-32
Current status:
df -hFind large files in the system:
sudo find / -type f -size +1000M -exec ls -lh {} \;Remove old kernels (keep 2 latest):
sudo dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)DNF Cleanups:
sudo dnf autoremove
sudo dnf remove --duplicates
sudo dnf remove --oldinstallonly
Move libvirt from root partition to home partition:
sudo cp -r /var/lib/libvirt /home
sudo rm -rf /var/lib/libvirt
sudo ln -s /home/libvirt /var/lib/libvirtFix SELinux issues with the symlink:
sudo su -
ausearch -c 'qemu-system-x86' --raw | audit2allow -M my-qemusystemx86
semodule -X 300 -i my-qemusystemx86.pp
ausearch -c 'libvirt_leasesh' --raw | audit2allow -M my-libvirtleasesh
semodule -X 300 -i my-libvirtleasesh.pp
Move docker from root partition to home partition:
sudo cp -r /var/lib/docker /home
sudo rm -rf /var/lib/docker
sudo ln -s /home/libvirt /var/lib/dockerDocker image cleanup:
docker image prune
docker rmi $(docker images -f "dangling=true" -q)...more docker cleanup:remove all stopped containers
docker container prune
and then prune images again. cleanup everyting not currently used by docker:
docker system prune -a -f
Find the 30 heaviest installed packages:
rpm -qa --queryformat '%{name} %{size}\n' | sort -n -k 2 -r | head -n 30Make sure that /tmp is cleaned on reboot:
systemctl unmask tmp.mountOld kernels:
rpm -q kernel-coreThen run:
sudo dnf remove <kernel-core-xxx>Log Files: See how much is used:
sudo journalctl --disk-usageMake sure that conf is right SystemMaxUse=50M:
sudo vi /etc/systemd/journald.conf
sudo systemctl restart systemd-journald.serviceImmdeiate cleanup:
sudo journalctl --vacuum-size=50M