clean out old kernel versions?

Robert Heller heller at deepsoft.com
Sun Mar 7 17:27:33 UTC 2021


At Sun, 7 Mar 2021 09:07:18 -0800 "Ubuntu user technical support, not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> On Sun, 7 Mar 2021 07:11:30 +0000
> Colin Law <clanlaw at gmail.com> wrote:
> 
> > On Sun, 7 Mar 2021, 05:55 Dave Stevens, <geek at uniserve.com> wrote:
> > 
> > > Linux user-Satellite-A100 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18
> > > 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux
> > >
> > > cat /etc/issue
> > > Linux Mint 18 Sarah \n \l
> > >
> > > --------------
> > >
> > >
> > > /boot has 440 files in it, almost all of which are old kernel
> > > entries. Is there a simple way to get rid of all but the most
> > > recent few (2 or 3)?
> > >  
> > 
> > 
> > Start with
> > sudo apt autoremove
> > 
> > Though that won't get rid of ones not removed before a mint version
> > upgrade.
> > 
> > Colin
> 
> sudo apt autoremove
> Reading package lists... Done
> Building dependency tree       
> Reading state information... Done
> 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> user at user-Satellite-A100 /boot $ 

OK, then how did you install the kernels?  Did you build them from source? 

It might be that you will just have to use rm (with care!) and then run 
update-grub to rebuild the grub.cnf file.  For any given kernel x.y.x-nnn-mumble, 
there will be vmlinuz-x.y.x-nnn-mumble, System.map-x.y.x-nnn-mumble, 
initrd.img-x.y.x-nnn-mumble, and config-x.y.x-nnn-mumble -- at least for 
Ubuntu/Mint kernels -- other distros might have other naming conventions.

*IF* you did install them with apt install, you should remove them with apt 
purge.  Oh, if you managed to remove the generic (unversioned) kernel-image 
package, that would have also removed the autoremove logic.  You probably 
should re-install it.

What does 'dpkg-query -l linux-image-generic' display?

> 
> 
> d
> > 
> > 
> > 
> > 
> > 
> > > I could find a use for that 4.4 GB of disk space.
> > >
> > > D
> > >
> > > --
> > > In modern fantasy (literary or governmental), killing people is the
> > > usual solution to the so-called war between good and evil. My books
> > > are not conceived in terms of such a war, and offer no simple
> > > answers to simplistic questions.
> > >
> > > ----- Ursula Le Guin
> > >
> > > --
> > > ubuntu-users mailing list
> > > ubuntu-users at lists.ubuntu.com
> > > Modify settings or unsubscribe at:
> > > https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> > >  
> 
> 
> 

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                         




More information about the ubuntu-users mailing list