http://askubuntu.com/questions/138026/how-do-i-delete-kernels-from-a-server
At the bottom of the page is the actual script to do the job.
Ever had a problem of endless kernels on your system without the storage to manage it?
No prob. You can remove old kernels with this script.
IMPORTANT:
If using GRUB legacy, be sure the menu.1st file contains an actual kernel you can use. Its easy to check the current kernel running with this command:
uname -R
NOTE this will reference the running kernel and is tied to the menu.1st. If you deleted the running kernel, just make sure you have an alternate. ALL kernels are stored in:
/boot.
Just ls to get a list of kernels.
DELETE all kernels. Note this is actually one line of text. The '\' is used to separate lines. Save it as a file.
#!/bin/sh
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