Показ дописів із міткою apt-get. Показати всі дописи
Показ дописів із міткою apt-get. Показати всі дописи

середу, 30 квітня 2014 р.

Ubuntu: Removing all legacy unused kernels

Sometimes you need to care about each MB of disk space. You are starting to cleanup drives, but there's nothing obviously can be deleted. In such cases you an free-up some space (from dozens to hundreds of MB) by removing all legacy system kernels.
In such case please make sure you are running the latest kernel version
Compare outputs for
uname -r
and
dpkg -l | grep linux-image
Probably you may need to reboot! Then just issue the following command:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge
References:
http://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/