lost and found ( for me ? )

Ubuntu server 10.10 : How to remove old kernels you don’t need


root@hat1:~# cat /etc/lsb-release | tail -1
DISTRIB_DESCRIPTION="Ubuntu 10.10"

1. check current kernel version you are using
root@hat1:~# uname -r
2.6.35-27-server

2. check all kernel versions you have installed
root@hat1:~# dpkg -l | grep ^ii | grep 2.6.35 | awk '{print $2}'
linux-headers-2.6.35-22
linux-headers-2.6.35-22-generic
linux-headers-2.6.35-22-server
linux-headers-2.6.35-23
linux-headers-2.6.35-23-generic
linux-headers-2.6.35-23-server
linux-headers-2.6.35-24
linux-headers-2.6.35-24-generic
linux-headers-2.6.35-24-server
linux-headers-2.6.35-25
linux-headers-2.6.35-25-generic
linux-headers-2.6.35-25-server
linux-headers-2.6.35-27
linux-headers-2.6.35-27-generic
linux-headers-2.6.35-27-server
linux-headers-generic
linux-headers-server
linux-image-2.6.35-22-server
linux-image-2.6.35-23-server
linux-image-2.6.35-24-server
linux-image-2.6.35-25-server
linux-image-2.6.35-27-server
linux-image-server
linux-libc-dev
linux-server
root@hat1:~#

3. remove 2.6.35-22

remove the following packages
root@hat1:~# dpkg -l | grep ^ii | grep 2.6.35 | awk '{print $2}' | grep 2.6.35-22
linux-headers-2.6.35-22
linux-headers-2.6.35-22-generic
linux-headers-2.6.35-22-server
linux-image-2.6.35-22-server

root@hat1:~# apt-get remove linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic linux-headers-2.6.35-22-server linux-image-2.6.35-22-server
<snip>
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-27-server
Found initrd image: /boot/initrd.img-2.6.35-27-server
Found linux image: /boot/vmlinuz-2.6.35-25-server
Found initrd image: /boot/initrd.img-2.6.35-25-server
Found linux image: /boot/vmlinuz-2.6.35-24-server
Found initrd image: /boot/initrd.img-2.6.35-24-server
Found linux image: /boot/vmlinuz-2.6.35-23-server
Found initrd image: /boot/initrd.img-2.6.35-23-server
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done

grub.cfg will be updated automatically.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.