Google Plus

Remove all unused kernels with 1 command in debian based systems

Written by Mel Kham on . Posted in Linux tutorials

As you know, everytime there is an update for the kernel, the new kernel is installed while the old one is not automaticaly uninstalled, after several kernel updates you will find a large list of old kernels in the start terminalgrub menu . So if we got no problem with the new installed kernel, we can just delete the old ones.

 

 

In my previous post i did show you how to uninstall older kernel in Ubuntu. Today I will show you another command to remove unused kernels:

sudo apt-get remove $(dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`)

 

Is done.

{module post forum}

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • Learning

    A short explanation for every command would be perfect.

  • bash

    pay attention with your ati drivers, fglrx and many other related programs like gearth will be removed!

  • 1ROXTAR

    Or if you are an Ubuntu user, you can use Ubuntu Tweak if you want to use a simple to use GUI.

  • Foo

    You need to cut off the text after the revision in Ubuntu.

    $(dpkg -l|egrep ‘^ii  linux-(im|he)’|awk ‘{print $2}’|grep -v `uname -r | cut -d- -f1,2`)

    • Alex

      Worked like a charm without cutting of anything.

    • Bernie Haverkamp

      This is still removing the meta package for the current kernel.

  • Mark Preston

    Could you explain to me how to run that command while in LiveUSB session? I have so many old kernels that the OS will not boot. You can see more of about that, if you wish at: http://ubuntuforums.org/showthread.php?p=12474844#post12474844 – I ran Boot-Repair-Disk and it says that / is too full (even though I know it has a little over a 1 gig (in 15 gig) free.

  • Stephen Harker

    This will actually pull out the linux-headers package for the live kernel as well which you don’t really want. ie. on my system it removes “linux-headers-3.5.0-22″ and “linux-headers-3.5.0-22-generic” but leaves “linux-image-3.5.0-22-generic” which is the live kernel.

    It also removes the meta package “linux-image-generic” which you want to keep if you want to get the kernel upgrades in the first place :)

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

cave

|

it can be used to talk or chat through the internet,

it is using strong encryption.

but for example TOR is using some obfuscation because some countrys try to block all outgoing connections which can not be scanned with DPI

And the TOR Project is facing an arms race in obfuscation and encryption detection.

cave

|

You can friend someone if you give him your public Certificate.

both peers must friend each other.

i suggest to not enter a valid e-mail address. it is not necessary, but pgp needs a mail addy. something@something.so fits perfectly… :)

http://redd.it/18vsq5 <– faq, featurelist, todo, howto, useful links to manual wiki etc, …

you can connect to chatservers, which will give you access to chatlobby, where always some people are lurking.

#1 https://www.f2f-fr.net/w2c/en/
#2 http://retrosharechatserver.no-ip.org/w2c/en/

and in this rooms, you can find other people to talk and friend.

cave

|

http://redd.it/18vsq5
please have a look at this link. it is a FAQ, QuickTip, HowTo, etc etc etc …

If you want to make friends, please use the Chatservers.
#1 https://www.f2f-fr.net/w2c/en/
#2 http://retrosharechatserver.no-ip.org/w2c/en/

if you enter your certificate, the chatserver adds you as his friend and shows his certificate too add him to your friends.

After the connection to the chatservers is established, you can join a few chatrooms where the chatserver is lurking.

in this rooms are other people too help you and make first friends and get into the network.

add friends only with wisdom. if you friend some policeman, it will be problematic like in real life.

best is to add only people you trust in real life or trust from other communitys too. and not to add random unkown strangers.

If you have questions, ask them in the chatlobbys, there is always someone to answer them.

please read http://redd.it/18vsq5

or question me here :)

Ladi Oyekanmi

|

Could you please assist in step by step on how to install nagios on solaris

Adhraa

|

Greate tutorial :)

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .