14

I have installed the mainline kernel 3.10 as recommended here so that I can have my WiFi.

I'm running into space problems as described here (dpkg configuration running out of space, having separate /boot)

Is it safe to run the recommended command described in this blog as pointed out in that answer? If not, how should it be modified? I'm using:

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

dpkg --list | grep linux-image

ii  linux-image-3.10.1-031001-generic         3.10.1-031001.201307131550           amd64        Linux kernel image for version 3.10.1 on 64 bit x86 SMP
ii  linux-image-3.8.0-19-generic              3.8.0-19.30                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-26-generic              3.8.0-26.38                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-27-generic              3.8.0-27.40                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-29-generic              3.8.0-29.42                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-19-generic        3.8.0-19.30                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-26-generic        3.8.0-26.38                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-extra-3.8.0-27-generic        3.8.0-27.40                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
iF  linux-image-extra-3.8.0-29-generic        3.8.0-29.42                          amd64        Linux kernel image for version 3.8.0 on 64 bit x86 SMP
iU  linux-image-generic                       3.8.0.29.47                          amd64        Generic Linux kernel image

I'm not sure about which ones are the latest. Please show me which ones are definitely the oldest and unneeded so they can be removed with sudo apt-get purge linux-image-x.x.x.x-generic.

3 Answers 3

7

Yes it's safe to remove kernels you don't use. However I would check this question first for other recommended ways to remove old kernels:

0
7

Use Computer Janitor!

The easy way to do this using the Ubuntu Tweak that have Computer Janitor.

enter image description here

Install

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak
0
2

Hm, I would leave 1 or 2 kernels in the installed systems. It is almost not possible, but it could be that by update the newest kernel gets malformed. So it would be possible to return then via the next installed kernel into system.

I only say this not because of Ubuntu, but of else distributions, where sometimes updates malformed the installation somehow. Ubuntu is quite secure and quite reliable with updating files. It belongs only to the circumspectly user or admin, to allow himself an additional emergency-mode for his system, besides the protected-mode.

4
  • I'm in the process of doing the second most voted answer in Jorge's link. would you mind noting edit and recommending which ones should be removed? ty!
    – user128334
    Aug 20, 2013 at 16:57
  • @Gracchus - hm? what you mean ? which kernel ones should be removed ? (my English is not best sometimes ... ) Aug 20, 2013 at 18:31
  • just a sec ago, your newly-edited question appears freshly updated. well, on my system I have removed kernel 3.2 and regret this up to today now ... Aug 20, 2013 at 18:33
  • 1
    I would leave 2 kernels of 3.8 (with straight numbers as version) and of course leave 3.10 in your system. There is no real receipt for that - regarding of volunteer-coders, where is not sure, which one is best. Aug 20, 2013 at 18:36

You must log in to answer this question.