Tips for Remove Legacy Kernel Image for Debian/Ubuntu
Submitted by hswong3i on Thu, 2013-01-24 08:02
After numbers of update to your Debian/Ubuntu installation, usually a lot of legacy kernel image are keep inside your box, so you may hope to remove all of them. Just execute following command (i.e. after aptitude -y full-upgrade && reboot):
dpkg -l 'linux-*' | \ sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | \ xargs sudo apt-get -y purge
Reference:
- hswong3i's blog
- 971 reads


Add new comment