Tired of Old Kernels (3.2, 3.4, 3.5 ..?) after an Ubuntu 12.10 upgrade.

Yes this is something that was annoying. I planned to keep two kernels (3.8, 3.4). The 3.5 just doesn’t boot up the nouveau NVidia 630M GEFORCE chip. I didn’t try 3.6. Bottom line, keep two working kernels, get rid of others.

Why two, another day to debate. I got emotionally attached to the 3.4 kernel 🙂


$ dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`
linux-headers-3.4.0-030400
linux-headers-3.4.0-030400-generic
linux-headers-3.5.0-24
linux-headers-3.5.0-24-generic
linux-headers-3.8.0-030800
linux-headers-generic
linux-image-3.4.0-030400-generic
linux-image-3.5.0-24-generic
linux-image-extra-3.5.0-24-generic
linux-image-generic

I did a manual purge of 3.5 as follows.


$ sudo apt-get remove linux-headers-3.5.0-24 linux-headers-3.5.0-24-generic linux-image-3.5.0-24-generic linux-image-extra-3.5.0-24-generic
[sudo] password for ram:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-generic linux-headers-3.5.0-24 linux-headers-3.5.0-24-generic
linux-headers-generic linux-image-3.5.0-24-generic
linux-image-extra-3.5.0-24-generic linux-image-generic
0 upgraded, 0 newly installed, 7 to remove and 5 not upgraded.
After this operation, 223 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 227216 files and directories currently installed.)
Removing linux-generic ...
Removing linux-headers-generic ...
Removing linux-headers-3.5.0-24-generic ...
Removing linux-headers-3.5.0-24 ...
Removing linux-image-generic ...
Removing linux-image-extra-3.5.0-24-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.5.0-24-generic /boot/vmlinuz-3.5.0-24-generic
update-initramfs: Deleting /boot/initrd.img-3.5.0-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.5.0-24-generic /boot/vmlinuz-3.5.0-24-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.8.0-030800-generic
Found initrd image: /boot/initrd.img-3.8.0-030800-generic
Found linux image: /boot/vmlinuz-3.5.0-24-generic
Found linux image: /boot/vmlinuz-3.4.0-030400-generic
Found initrd image: /boot/initrd.img-3.4.0-030400-generic
Found memtest86+ image: /boot/memtest86+.bin
done
The link /initrd.img is a damaged link
Removing symbolic link initrd.img
you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
you may need to re-run your boot loader[grub]
Removing linux-image-3.5.0-24-generic ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 3.5.0-24-generic /boot/vmlinuz-3.5.0-24-generic
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.5.0-24-generic /boot/vmlinuz-3.5.0-24-generic
update-initramfs: Deleting /boot/initrd.img-3.5.0-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.5.0-24-generic /boot/vmlinuz-3.5.0-24-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.8.0-030800-generic
Found initrd image: /boot/initrd.img-3.8.0-030800-generic
Found linux image: /boot/vmlinuz-3.4.0-030400-generic
Found initrd image: /boot/initrd.img-3.4.0-030400-generic
Found memtest86+ image: /boot/memtest86+.bin
done
The link /vmlinuz is a damaged link
Removing symbolic link vmlinuz
you may need to re-run your boot loader[grub]
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]

After the purge, I updated the bootloader


$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.8.0-030800-generic
Found initrd image: /boot/initrd.img-3.8.0-030800-generic
Found linux image: /boot/vmlinuz-3.4.0-030400-generic
Found initrd image: /boot/initrd.img-3.4.0-030400-generic
Found memtest86+ image: /boot/memtest86+.bin
done

Rebooted, pressed “Shift” to make sure I selected the 3.8 Kernel. Voila, every is just the way it should be.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s