(Found at http://tuxtweaks.com/2010/10/remove-old-kernels-in-ubuntu-with-one-command/)
You can first check that the correct packages are selected to remove with;
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove
and if you are happy remove those with this;
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge
No comments:
Post a Comment