LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 07-22-2006, 09:32 PM   #1
joe3eagles
LQ Newbie
 
Registered: Dec 2005
Location: Fort Collins, Colorado, USA
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 0
Question Need to remove old versions of Ubuntu kernel


Hey folks,

I'm looking to clean up older versions of Ubuntu from my hard drive as well as merely from the GRUB menu. I know that editing the /boot/grub/menu.lst file will clean up the menu, but what about the actual older kernels and other related stuff? Shouldn't those also be removed? I found the /lib/modules/ directory. Do those and/or other files need to be deleted? Would deleting them cause problems?

Thanks for any pointers!

Joe
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-22-2006, 09:40 PM   #2
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,776

Rep: Reputation: 66
Go to Synaptic Package Manager or Adept and search for linux-image.
 
Old 07-22-2006, 09:57 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,118

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
... and select the ones you want deleted.
You'll get an option to remove completely - will get rid of any modules (including restricted) as well.
 
Old 06-10-2008, 08:04 AM   #4
Tim Silver
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
OK. I notice that this thread has been viewed 18,510 times but I appear to be the only one with a further question!

Having looked-up 'linux-image' in Synaptics Package Manager, how do I know which ones are safe to remove?

Am I to be guided by the checkboxes on the left (some grayed-out, some with an icon?) or if they don't have an entry in the 'Installed Version' column?

Complete noob to any form of linux and do not want to risk any harm to system!

Any advice much appreciated.
 
Old 06-21-2008, 10:07 AM   #5
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 66
If you remove the linux-images for a particular kernel, shouldn't you remove the linux-headers for that version as well?
 
Old 06-21-2008, 10:38 AM   #6
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
@Tim Silver,
The command uname -a in a terminal will tell you which kernel you are running as opposed to which kernels you may have available. Mine looks like this:
Code:
tred@vaio:~$ uname -a
Linux vaio 2.6.24-19-generic #1 SMP Wed Jun 4 16:35:01 UTC 2008 i686 GNU/Linux
tred@vaio:~$
So I can remove all kernels, and headers and sources except 2.6.24-19-generic
In practice, I like to keep at least one "old" kernel, in case I find that the latest one has broken something that used to work with the older kernel.

HTH &
Welcome to LQ!
 
Old 07-14-2008, 11:14 AM   #7
oserdavid
LQ Newbie
 
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
I hope I'm not hijacking a thread - but this is very related.
I'm running dual boot Ubuntu 8.04 and Windows Vista. I understand that when Ubuntu 8.04 is replaced by the next full incarnation of Ubuntu - it can be installed by simply 'updating' - which I understand. However, I have grub set up to launch Vista/Longhorn as default, and have edited grub's menu.list so that this remains the case when new kernels of Hardy are introduced, removing the old kernels, as suggested above. My question is, would the new full version of Ubuntu retain my grub settings, or will I need to edit a new version of grub, as I did the old one?
 
Old 08-22-2008, 03:31 AM   #8
larookh
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 1
haha I just did the same thing...

Ok so without apt- and without anything else

ok so maybe you screwed up and deleted it in dolphin like I did...

so I did this

su -s -H

gives you a root screen

go to /boot

ls -a
will show you everything

go into your trash folder

ls .Trash-0

rm both files and then mkdir both of them back

Alright so then I ran the dpkg --configure -a

everything worked!
 
1 members found this post helpful.
Old 04-13-2009, 09:37 PM   #9
digitalpbk
LQ Newbie
 
Registered: Apr 2009
Posts: 5

Rep: Reputation: 0
Cool Command Line Way

Code:
sudo apt-get remove --purge 2.6.2x-xx-*
where x is the old kernel version subversion numbers

use
Code:
uname -r
to find the current version and dont remove that.

for more details check
http://digitalpbk.blogspot.com/2008/...list-long.html
 
Old 07-28-2009, 04:51 PM   #10
WSCCGreg
LQ Newbie
 
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
I dual boot Vista and Ubuntu. With the list of kernel versions getting really long, I tried to erase the older ones and I think I erased them all. When I boot up I still come to the menu that allows me to choose, but there's no longer a choice for Ubuntu, only Windows. Can I reinstall the kernel without reinstalling Unbuntu?
 
Old 07-28-2009, 05:31 PM   #11
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
With the list of kernel versions getting really long, I tried to erase the older ones and I think I erased them all. When I boot up I still come to the menu that allows me to choose, but there's no longer a choice for Ubuntu, only Windows.
Well, when you "erased them all", you probably just did exactly that, and you won't have a choice to boot them, because there is no longer anything to boot: They don't exist, because you erased them.

Perhaps a reinstall of your preferred distro is needed now.

In future, please start a new thread for a new problem.

Welcome to LQ!

[Edit:] If you have vital files on your linux partitions, they can maybe be recovered. Post more information [/Edit]

Last edited by tredegar; 07-28-2009 at 05:37 PM.
 
Old 12-12-2009, 07:34 AM   #12
EllisDee
LQ Newbie
 
Registered: Dec 2009
Posts: 8

Rep: Reputation: 0
I too am a beginner with ubuntu. I had to reinstall ubuntu and the old version is still showing in grub how do I know which image is the old one and which is the new. Like tim said is it the greyed out boxes if not why are some greyed out
 
Old 12-12-2009, 11:27 AM   #13
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
I had to reinstall ubuntu and the old version is still showing in grub how do I know which image is the old one and which is the new. Like tim said is it the greyed out boxes if not why are some greyed out
The "greyed out boxes" probably refer to kernels that are mentioned in grub's configuration file (I am being deliberately vague here, as I do not know for sure if you are using grub or grub2, I suspect the latter, which I have little experience of).

You can either ignore them, try booting from them (may not work, but you may get a useful error message), or edit the configuration file to remove them.

The "latest version" is likely to be the default one at the top of the list, with the most up-to-date number.

Welcome to LQ!
 
Old 08-09-2010, 08:40 PM   #14
totn
LQ Newbie
 
Registered: Mar 2009
Posts: 5

Rep: Reputation: 5
Old Packages Still Appear In Grub2

I've never responded here before. Hope I'm doing it correctly. I had a large number of old kernels which did not appear in Synaptic Package Manager. I realized with the help of this thread, that I no longer actually had the packages. To eliminate the listings from the grub2 menu I opened a terminal. Then typed cd /boot. Then ls to list the contents. From there I used rm to remove all related files eg. sudo rm /boot/vmlinuz-2.6.28-15-generic, sudo rm /boot/initrd.img-2.6.28-15-generic, sudo rm vmcoreinfo-2.6.31-15-generic, sudo rm System.map-2.6.31-15-generic, sudo rm config-2.6.28-15-generic, sudo rm abi-2.6.31-15-generic. I did this for each unwanted version. I don't know if I had to remove all those files but since they referred to old unwanted versions I got rid of them anyways. I then typed sudo update-grub, crossed my fingers (a meaninless ritual) and did a reboot. Now all is well. I hope this answer helps someone out there...
 
1 members found this post helpful.
Old 08-09-2010, 08:58 PM   #15
totn
LQ Newbie
 
Registered: Mar 2009
Posts: 5

Rep: Reputation: 5
Kernels are No Longer In Synaptic Package Manager...

I've never responded here before. Hope I'm doing it correctly. I had a large number of old kernels which did not appear in Synaptic Package Manager. I realized with the help of this thread, that I no longer actually had the packages. To eliminate the listings from the grub2 menu I opened a terminal. Then typed cd /boot. Then ls to list the contents. From there I used rm to remove all related files eg. sudo rm /boot/vmlinuz-2.6.28-15-generic, sudo rm /boot/initrd.img-2.6.28-15-generic, sudo rm vmcoreinfo-2.6.31-15-generic, sudo rm System.map-2.6.31-15-generic, sudo rm config-2.6.28-15-generic, sudo rm abi-2.6.31-15-generic. I did this for each unwanted version. I don't know if I had to remove all those files but since they referred to old unwanted versions I got rid of them anyways. I then typed sudo update-grub, crossed my fingers (a meaninless ritual) and did a reboot. Now all is well. I hope this answer helps someone out there...
 
4 members found this post helpful.
  


Reply

Tags
grub, grub2, hardy, kernels, old, remove, ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GLIB - two versions. how to remove oldest? zivs Linux - Newbie 4 06-18-2006 01:09 PM
gcc versions compatibility with kernel versions.. mahesh_manthapuri Suse/Novell 1 03-22-2006 12:28 AM
LXer: Updating Ubuntu 5.10 for Current Versions of OpenOffice and FireFox LXer Syndicated Linux News 0 02-06-2006 01:46 PM
2 versions installed, can't remove either JimBass Fedora 7 01-28-2005 06:08 PM
Help to remove Ubuntu philip41 Linux - Hardware 3 01-13-2005 05:08 PM


All times are GMT -5. The time now is 03:07 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration