excessive /boot entries SOLVED - and thank you

Derek Broughton derek at pointerstop.ca
Wed Apr 1 23:26:20 UTC 2009


Lisi Reisz wrote:

> On Wednesday 01 April 2009 10:59:52 Alvin wrote:
>> On Wednesday 01 April 2009 11: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.
> 
> Thank you very much. :-)  It is now fine.  The grub menu-lst is now a
> reasonable length.
> 
> I used aptitude purge and the dpkg --get-selections > installed-software
> option with copying and pasting.  I then edited the remaining menu.lst to
> get

If you're using aptitude to install, then it can be easier than this.  See:
 /etc/apt/apt.conf.d/01autoremove

I think you know enough to interpret that, but for others it means that
_normally_ unneeded packages get removed when packages that depend on them
no longer do.  But kernels are intentionally kept.  You can change that
behaviour, and allow it to purge all the kernels.  This isn't a great idea
if you only have a single machine, but if you have a group of machines with
identical hardware, you might test on one machine and set the others to
always purge kernels - only upgrading the kernel when you've tested it on
the first machine.  This _might_ work with updates done with anything but
aptitude, but I only know aptitude :-)

What _I_ do though (difficult with 50+ kernels, but works when you use it
regularly) is:

# sudo aptitude purge ~i2.6.24-23

This says "purge any (installed) package containing the string 2.6.24-23". 
It's convenient that that format has always matched only kernels and
supporting packages so far - of course there's no reason that somebody else
couldn't create a package with the string in the name, but in my case that
tells me:

The following packages will be REMOVED:
  linux-headers-2.6.24-23{p} linux-headers-2.6.24-23-generic{p}
linux-image-2.6.24-23-generic{p}
linux-restricted-modules-2.6.24-23-generic{p}
  linux-ubuntu-modules-2.6.24-23-generic{p}

and prompts.  Obviously if somebody else did put that string in their
package name, you'd be able to tell before saying "y".

> the default altered to the version of the kernel That I wanted.  I also
> changed "how-many=all" to "howmany=2".

I've done that before, but these days I find it better to keep it to "all",
so that I always know which packages need to be purged.
-- 
derek





More information about the kubuntu-users mailing list