Should aptitude provide a way to remove old kernel versions ?

Asked by SlugiusRex on 2014-10-30

I install the earliest possible ALPHA version of every different Ubuntu as soon as they come out.

Consequently, gobs of old kernel versions pile up during the development process. There is no easy way to remove them. The following URL "How do I remove or hide old kernel versions to clean up the boot menu?" (http://askubuntu.com/questions/2793/how-do-i-remove-or-hide-old-kernel-versions-to-clean-up-the-boot-menu) provides some guidance, but there should be a better way.

Aptitude can be used to install the new versions of the kernel - so it kinda makes sense that it could also be used to remove them. Not just remove the packages, but uninstall them from boot menu too.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu aptitude Edit question
Assignee:
No assignee Edit question
Last query:
2014-10-30
Last reply:
2014-10-31
SlugiusRex (slugiusrex) said : #2

That does seem very clever. However, I anticipate the following problems:

1) Sometimes I run Ubuntu Server which doesn't have a GUI option.

2) I most need to eliminate the old kernel versions when the /boot partition runs out of space. Typically when I am already in aptitude anyway. Would installing this consomme additional space in /boot ?

SlugiusRex (slugiusrex) said : #3

That does seem very clever. However, I anticipate the following problems:

1) Sometimes I run Ubuntu Server which doesn't have a GUI option.

2) I most need to eliminate the old kernel versions when the /boot partition runs out of space. Typically when I am already in aptitude anyway. Would installing this consomme additional space in /boot ?

If you remove the old packages for the old kernels it will clean up GRUB. If you run:

uname -r

You will see the current running kernel version. If you run:

dpkg -l | grep linux-image | awk {'print $2'} | grep -v extra

You will see the installed kernels. You can use apt-get or aptitude to remove the old kernels but NOT the running one.

Reboot to test

Manfred Hampl (m-hampl) said : #5

apt-get has an autoremove feature that uninstalls all packages that are not needed as dependencies and have not been installed manually. Since Ubuntu 14.04 all obsolete kernels and headers should automatically be flagged as no more needed, and thus can be purged with the apt-get autoremove command. (There are reports that this does not yet fully work). I am not aware of a feature in aptitude that is similar to apt-get's autoremove.

Can you help with this problem?

Provide an answer of your own, or ask SlugiusRex for more information if necessary.

To post a message you must log in.