How to remove old kernels with computer janitor

Alin-Andrei nilarimogard at gmail.com
Sat Jan 9 22:56:47 UTC 2010


This command purges the unused linux headers, images and modules:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed
"s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' |
xargs sudo apt-get -y purge

Found it on
http://www.commandlinefu.com/commands/view/2456/purge-installed-but-unused-linux-headers-image-or-modulesand
works :)

Andrew


On Fri, Jan 8, 2010 at 19:05, Faizan Kazi <faizan.s.kazi at faizan-kazi.com>wrote:

> yup, sorry the computer janitor doesn't do that. but it'd be kinda cool if
> it did right?? :)
> if you really wanna do that you've gotta find entries beginning with
> "linux-image-" and remove them in synaptic package manager... MAKE SURE to
> keep atleast one installed. I have NO idea what'd happen if you tried to
> remove all of them.
>
> you can also do a "sudo apt-get remove linux-image-SOMETHING
> use the Tab key auto completion to help you out there :)
>
> ~fez
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100110/e93c50bd/attachment.html>


More information about the ubuntu-users mailing list