Ubuntu springtime cleaning

Clean up the junk that Ubuntu Desktop brings, esp if you are actually running a server

# remove desktop  related stuff
apt purge ubuntu-desktop -y && sudo apt autoremove -y && sudo apt autoclean
# apt
apt autoclean
apt autoremove
# apt archives still filled with junk
du -hd1 /var/cache/apt
apt clean

# old kernel modules
ls /usr/lib/modules
apt remove $(dpkg-query --show 'linux-modules-*' | cut -f1 | grep -v "$(uname -r)")

# remove old logs
find /var/log -name "*.gz" | xargs rm -f
# (some more you can find by hadn and remove, if you are confident you can do so)

Leave a comment