excessive /boot entries

Antonio Augusto (Mancha) mkhaos7 at gmail.com
Wed Apr 1 17:19:37 UTC 2009

On Wed, Apr 1, 2009 at 07:05, Lisi Reisz <lisi.reisz at gmail.com> wrote:
> On Wednesday 01 April 2009 10:53:54 Lisi Reisz wrote:
>> On Wednesday 01 April 2009 09:38:49 Alvin wrote:
>> > On Wednesday 01 April 2009 10:23:59 Lisi Reisz wrote:
>> > > On investigation I found that there are about 60 kernels in /boot(1),
>> > > from which I imagine that menu.lst has retrieved its very long list.
>> > > Can I safely remove most of the entries in /boot (rm foo), and then
>> > > edit menu.lst, and if so, which do I need to keep.  Not only are there
>> > > more kernels than seem necessary (or desirable!), but each seems to
>> > > have too many options.
>> > >
>> > > So:  Which entries should I keep?
>> >
>> > Keep in mind that these kernels are all installed packages. Keep the last
>> > one, or the last two and just purge the rest. The menu.lst will be
>> > adapted and you will gain some disk space.
>> >
>> > For example:
>> > $ sudo apt-get purge linux-headers-2.6.27-14
>> > linux-headers-2.6.27-14-generic linux-image-2.6.27-14-generic
>> > linux-restricted-modules-2.6.27-14-generic
>> >
>> > Of course, do not remove your running kernel. You can check your kernel
>> > version with 'uname'.
>> How do I find out what the package name of each kernel is?  Or what else am
>> I doing wrong?(1) I have inserted blank lines between attempts for the sake
>> of legibility.
> Nothing like answering one's own questions. :-(  I stopped panicking and
> remembered that I can simply get a list of installed packages.  So I'll start
> with that and come back if I still have problems.
> Sorry for the noise. :-(
> Lisi

Ok, before telling you how to remove all those kernels one little
advice: find out why the heck all those packages got installed. As
said by others, these files are installed alongside some packages, and
these packages are installed by a reason. Maybe the owner of the
computer just decided to intall all packages that started with "linux"
for the sake of it, or else, you might have a weirder problem at hand.

Now, for the solution: I'm not on my Linux box right now, so there
might be some mistakes on the command bellow, but basically what you
want is to remove (apt-get purge) all linux images (i.e: kernels) and
headers (linux-image and linux-headers) except the one you are
actually using (uname -r).
So you should do something like this on the terminal:

sudo apt-get -s autoremove `aptitude search linux-image\|linux-headers
| grep ^i | grep -v `uname -r``

It will simulate an uninstall, if all looks Ok, THEN remove the -s
from the command above.
If you don't want to test it on your friends computer, wait I get home
to try it out, or someoneelse here says the command is Ok.


More information about the kubuntu-users mailing list