Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 5 down vote accepted

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:

share|improve this answer

Use Computer Janitor!

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

enter image description here

Download .deb file

share|improve this answer
1  
Thanks, It did the trick –  dariush Mar 6 at 14:22
    
@dariush You're welcome! –  Anton Dozortsev Mar 6 at 16:55

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.

share|improve this answer
    
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 '13 at 16:57
    
@Gracchus - hm? what you mean ? which kernel ones should be removed ? (my English is not best sometimes ... ) –  dschinn1001 Aug 20 '13 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 ... –  dschinn1001 Aug 20 '13 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. –  dschinn1001 Aug 20 '13 at 18:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.