Thursday, 14 June 2012

Cleaning up old Ubuntu kernels from /boot

My Ubuntu system told me today that it was running quite low on room in /boot. I searched around for what to do about that, and found this answer on Ask Ubuntu. It turns out that when kernel updates are applied, old kernels are left lying around in /boot.
So what to do? It's quite simple:

  1. Ensure you don't have a restart pending (Linux can update just about anything without rebooting...except the kernel). If you do, restart.
  2. Check to see what kernel you're using with uname -a:
    $ uname -a
    Linux forge 3.0.0-21-generic #35-Ubuntu SMP Fri May 25 17:57:41 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
    That's telling me that I'm using kernel 3.0.0-21-generic.
  3. List what kernels you have installed:
    $ sudo dpkg -l linux-image-\* | grep ^ii
    ii  linux-image-3.0.0-16-generic  3.0.0-16.29  Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-17-generic  3.0.0-17.30  Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-19-generic  3.0.0-19.33  Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-20-generic  3.0.0-20.34  Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-21-generic  3.0.0-21.35  Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-generic           3.0.0.21.25  Generic Linux kernel image
    
  4. Uninstall the oldest one(s):
    $ sudo apt-get purge linux-image-3.0.0-16-generic
    ...and so on, being sure not to uninstall the one you're using.
Many thanks to Lekensteyn for the answer, and user6722 for the question.

20 comments:

Flotsam said...

Thank you, thank you - my /boot partition had reached 100% and most other methods (e.g. apt-get remove) failed because they needed to write at least a little bit to the partition and died for lack of space...

This worked great!

Chris said...

sudo apt-get autoremove

Removes all but the current image and the previous one (at least, that's what it did for me). YMMV.

T.J. Crowder said...

@Chris: Interesting. That didn't work for me.

Dominick said...

We should always hire the best maid from transfer maid agency singapore and if you hire transfer maid now then you can get them at a cheap cost. So, you can go to hire a transfer maid as soon as possible because due to coronavirus almost every maid who has arrived from countries got stuck there.

eman shaaban said...


شركات نقل عفش فى خميس مشيط
شركة تسليك مجارى بخميس مشيط
شركة تنظيف بابها و بخميس مشيط
شركة تنظيف بالخميس
شركة تنظيف بخميس
شركة كشف تسريبات المياة وارتفاع فاتورة المياه
شركة تنظيف المنازل والفلل

Siscom said...

Sweet blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Many thanks General Practitioners’ office cleaning services

pirlo said...

perte de poids de Laurence Boccolini
carla moreau chirurgie esthétique
https://clinique-equilibre-lifting-visage.com/lifting-visage-tunisie/
https://clinique-equilibre-lifting-visage.com/lifting-cervico-facial-tunisie/
https://clinique-equilibre-lifting-visage.com/lifting-temporal-tunisie/

Clinique Equilibre Augmentation mammaire said...

Refaire la poitrine en Tunisie
Augmentation mammaire Tunisie
Lipofilling seins Tunisie
Reconstruction mammaire Tunisie
https://clinique-equilibre-augmentation-mammaire.com/sejour/
https://clinique-equilibre-augmentation-mammaire.com/avis/

Patrice Rozini said...

Liposuccion laser prix Tunisie
Réduction mammaire pas cher Tunisie
Liposuccion Tunisie pas cher
Tarif PRP cheveux Tunisie
Prix abdominoplastie Tunisie
Blanchiment dentaire Tunisie
Chirurgie esthetique Tunisie prix
Lifting cuisses Tunisie
Facette dentaire Tunisie prix
Operation sleeve Tunisie prix

Patrice Rozini said...

Septoplastie Tunisie prix
Augmentation fesses Tunisie prix
Lifting seins Tunisie prix
Greffe cheveux Tunisie prix
Lipofilling visage Tunisie prix
Bypass Tunisie prix
Lipofilling fesses Tunisie prix
Lipofilling seins Tunisie prix
Rhinoplastie Tunisie prix
Augmentation mammaire Tunisie prix

Patrice Rozini said...

https://www.chirurgie-obesite-tunisie.net/
Bypass en Tunisie prix
Mini bypass en Tunisie prix
Sleeve en Tunisie prix
Prix anneau gastrique en Tunisie

====================================

Abdominoplastie prix Tunisie
Mini abdominoplastie prix Tunisie
Abdominoplastie tarif Tunisie

Patrice Rozini said...

Liposuccion en Tunisie prix

Liposuccion visage prix en Tunisie
Liposuccion cou prix en Tunisie
Liposuccion menton en Tunisie prix

Liposuccion bras prix en Tunisie
Liposuccion ventre en Tunisie prix
Liposuccion hanche en Tunisie

Patrice Rozini said...

Liposuccion culotte cheval en Tunisie
Liposuccion fesses en Tunisie prix
Liposuccion jambes en Tunisie prix

Liposuccion cuisses en Tunisie prix
Liposuccion mollet en Tunisie
Liposuccion genoux en Tunisie prix

Medmammaire said...

augmentation mammaire Tunisie
prothese mammaire Tunisie tarif

chirurgie dentaire Tunisie said...

traiter la rosacee

chirurgie said...

blepharoplastie en tunisie
chirurgie nez tunisie prix

mtom00000 said...

There are incredibly plenty of details that way take into consideration. This is a excellent examine talk about. I supply the thoughts above as general inspiration but clearly you can find questions just like the one you retrieve in which the biggest factor will probably be in the honest great faith. I don?t know if best practices have emerged around such thinggs as that, but Almost certainly that your chosen job is clearly labeled as an affordable game. Both kids have the impact of simply a moment’s pleasure, throughout their lives. Commercial sanitation company arizona

Patrice Rozini said...

Prix chirurgie esthetique
Prix chirurgie esthetique tunisie

chirurgie dentaire Tunisie said...

lifting seins
smile hollywood
implant dentaire tarif

eman gamal said...

شركة تنظيف بخميس مشيط
شركة تنظيف خزانات بخميس مشيط
شركة تنظيف خزانات بمحايل عسير
شركة تنظيف خزانات ببيشة
شركة تنظيف خزانات بوادي بن هشبل
شركة تسليك مجاري بأحد رفيدة