Fedora outdated versions boot menu enteries

Hello,

I am new to Fedora.

There are too many entries in my grub menu, it adds one every time I update for the updated version, but it keeps the old one.

How could I remove all the outdated entries?

Also, is there a way to remove the old entries automatically?

Thanks!

1 Like

Hi @amitgold! Welcome to the community. Please take a minute to go through the posts in #start-here here if you haven’t had a chance yet.

By default, Fedora keeps the last 3 kernels to be on the safe side. So in case the newest kernel doesn’t work as well as it should with your hardware, you can reboot into an older one. These are what you see in your grub boot menu. You can see what these are using rpm:

$ rpm -qa \*kernel-core\*
kernel-core-5.0.16-300.fc30.x86_64
kernel-core-5.0.14-300.fc30.x86_64
kernel-core-5.0.11-300.fc30.x86_64

If you are not low on disk space, I would strongly recommend leaving these installed. However, if you must remove a kernel, simply use dnf remove ... but please do be careful :slight_smile:

The default number of kernels that are kept around are configured in the dnf configuration file: /etc/dnf/dnf.conf. You can read more about this file using its man page: man dnf.conf. Here are the relevant bits for your convenience:


       installonlypkgs
	      list

	      List  of	provide names of packages that should only ever be installed, never upgraded. Kernels in particular fall into this category.  These packages are never removed by
	      dnf autoremove even if they were installed as dependencies (see clean_requirements_on_remove for auto removal details).  This option append the list values to the  default
	      installonlypkgs list used by DNF. The number of kept package versions is regulated by installonly_limit.

       installonly_limit
	      integer

	      Number of installonly packages allowed to be installed concurrently. Defaults to 3. The minimal number of installonly packages is 2. Value 0 or 1 means unlimited number of
	      installonly packages.

1 Like

Oh, I didn’t know that.
Thanks!!

1 Like

So, since I don’t have an installonlypkgs option in my /etc/dnf/dnf.conf, the kernel package is in the default installonlypkgs list used by DNF.
Do you know how to see such default list?

1 Like

i think at least the kernel case is hard-coded in dnf: https://github.com/rpm-software-management/dnf/blob/af0bdb4811c98199215595ca75d2eb00db487e78/dnf/cli/cli.py#L1070

1 Like

No worries, when you’ve earned enough “trust”, please come back to this post and mark the answer as correct if you think it is so. (How to do this, and more is documented in the #start-here posts).

Cheers!