Fedora Linux Support Community & Resources Center
  #1  
Old 2nd February 2011, 12:51 AM
donkeyend Offline
Registered User
 
Join Date: Jul 2005
Posts: 82
linuxchrome
Automatically Remove GRUB Entries

I'm trying to automatically remove some of the old GRUB entries that pile up after a few updates and just want to leave live 2 or 3 there along with my Win7 entry. I was looking and saw that there is a utility for Ubuntu but I couldn't find anything for Fedora. Anyone know how to do this? Thank you!
Reply With Quote
  #2  
Old 2nd February 2011, 01:00 AM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,550
linuxdebianiceweasel
Re: Automatically Remove GRUB Entries

You shouldn't need to do that. The rpm script that installs or uninstalls a kernel also takes care of the grub.conf file. And removing an unwanted kernel is easy to do with rpm or yum. But manually deleting menu entries for installed kernels from the grub.conf without actually uninstalling the kernels is a bad idea IMO. Besides, just doing that would not remove the 100 MB or so of disk space being used by a kernel. You can, however, configure yum to retain fewer installed kernels than the default three.
Reply With Quote
  #3  
Old 2nd February 2011, 01:05 AM
bodhi.zazen Offline
Registered User
 
Join Date: Jul 2006
Location: Montana
Posts: 731
unknownunknown
Re: Automatically Remove GRUB Entries

Quote:
Originally Posted by donkeyass View Post
I'm trying to automatically remove some of the old GRUB entries that pile up after a few updates and just want to leave live 2 or 3 there along with my Win7 entry. I was looking and saw that there is a utility for Ubuntu but I couldn't find anything for Fedora. Anyone know how to do this? Thank you!
Even better, Fedora only keeps 2 old kernels by default, so as you receive updated kernels, the old will be removed and grub updated.
__________________
If it is not broken, tweak it... If you break Fedora you get to keep both pieces :p
Reply With Quote
  #4  
Old 2nd February 2011, 01:11 AM
donkeyend Offline
Registered User
 
Join Date: Jul 2005
Posts: 82
linuxchrome
Re: Automatically Remove GRUB Entries

Quote:
But manually deleting kernels from the grub.conf without actually uninstalling the kernel is a bad idea IMO.
hmm never thought about that, sounds good though lol.

Quote:
You can, however, configure yum to retain fewer or more kernels than the default three.
how could i go about doing that?

---------- Post added at 05:11 PM ---------- Previous post was at 05:06 PM ----------

Quote:
Even better, Fedora only keeps 2 old kernels by default, so as you receive updated kernels, the old will be removed and grub updated.
i must have accidentally configured something differently then because i have a bunch lol
Reply With Quote
  #5  
Old 2nd February 2011, 01:13 AM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,550
linuxdebianiceweasel
Re: Automatically Remove GRUB Entries

Edit /etc/yum.conf and decrease (or increase) the value of installonly_limit. The default is three which causes yum to hang on to the two most recent old kernels. Those two plus the current kernel are the three that installonly_limit means.

Quote:
Originally Posted by donkeyass

i must have accidentally configured something differently then because i have a bunch lol
After checking /etc/yum.conf, then find out if all of those really are installed...
Code:
rpm -qa | grep kernel | sort
If you're willing, post that. Also post the grub.conf file. It might be interesting.
Reply With Quote
  #6  
Old 2nd February 2011, 01:15 AM
donkeyend Offline
Registered User
 
Join Date: Jul 2005
Posts: 82
linuxchrome
Re: Automatically Remove GRUB Entries

awesome! thank you all very much :-)
Reply With Quote
  #7  
Old 2nd February 2011, 09:55 AM
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
linuxfedorafirefox
Re: Automatically Remove GRUB Entries

There's also a utility that is installed as part of yum-utils called package-cleanup that has a specific option for removing old kernels:
Code:
su - -c "package-cleanup --oldkernels --count=n"
will remove old kernels keeping the last n (default=2)
Reply With Quote
  #8  
Old 2nd February 2011, 09:13 PM
sidebrnz Offline
Registered User
 
Join Date: Oct 2007
Location: Freedonia
Age: 65
Posts: 2,624
linuxfedorafirefox
Re: Automatically Remove GRUB Entries

Thank you. I recently upgraded to F 14 and ended up with the F 14 kernel in grub.conf and the last three F 13 kernels. It's not a matter of space, but it's sloppy and I wanted to tidy things up.
__________________
Registered Linux user #470359 and permanently recovered BOFH.

Any advice in this post is worth exactly what you paid for it.
Reply With Quote
Reply

Tags
automatically, entries, grub, remove

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


Current GMT-time: 07:45 (Saturday, 25-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Ambilobe Instagram Photos - Wola - Porto-Novo