How to clean up Boot Menu

I am running 13.1/KDE.

My boot menu has accumulated several old entries over the past couple years, due to kernel updates and the like.

I know I have seen references on how to remove the legacy boot options, but now cannot find the reference.
Any pointers?
Thanks

Older kernels should be removed automatically.

This is done by “purge-kernels.service”, so check whether this is enabled:

systemctl status purge-kernels

If not, enable it:

sudo systemctl enable purge-kernels

You can also use YaST->System->Services Manager to check the status or enable/disable the service.

You can run the script manually as well, to clean up now:

sudo /sbin/purge-kernels

How many kernels are kept can be configured in /etc/zypp/zypp.conf:

## Comma separated list of kernel packages to keep installed in parallel, if the
## above multiversion variable is set. Packages can be specified as
## 2.6.32.12-0.7 - Exact version to keep
## latest        - Keep kernel with the highest version number
## latest-N      - Keep kernel with the Nth highest version number
## running       - Keep the running kernel
## oldest        - Keep kernel with the lowest version number (the GA kernel)
## oldest+N      - Keep kernel with the Nth lowest version number
##
## Note: This entry is not evaluated by libzypp, but by the
##       purge-kernels service (via /sbin/purge-kernels).
##
## Default: Do not delete any kernels if multiversion = provides:multiversion(kernel) is set
multiversion.kernels = latest,latest-1,running

You could disable that feature completely by commenting out the “multiversion” option a few lines before that.

Other than that, you can also remove specific kernel versions manually in YaST. Select the kernel (-desktop?) package and click on “Versions” below the package list.

This all applies only if you installed kernels via zypper/YaST/the update applet, i.e. via RPM packages, of course.
If you installed kernels by compiling from source f.e., you have to removee them by hand.

Wow, you really type fast :slight_smile:

Thanks, service was enabled but inactive.
So I tried

sudo /sbin/purge-kernels
root's password:
/sbin/purge-kernels: Running kernel 3.11.10-9.gdf9697b-x86_64/desktop not installed.
NOT removing any packages for flavor x86_64/desktop.
/sbin/purge-kernels: Nothing to do.
carl@PVE-LinuxSRV5:/etc/default> 

Sort of a strange message, how can my running kernel not be installed?

I always use YAST GUI for management.
I DO have the Kernel upstream Repo enabled; I needed it early on due to early 13.1 Bluetooth issues
I was getting a lot of updates, so locked on one that worked

uname -a
Linux PVE-LinuxSRV5 3.11.10-9.gdf9697b-desktop #1 SMP PREEMPT Wed Jan 8 15:41:04 UTC 2014 (df9697b) x86_64 x86_64 x86_64 GNU/Linux

Perhaps that messes with the purge service?

I see 3.11.10-21.1-x86_64 is now the latest in 13.1 Update repo; perhaps I should just switch to that

That’s https://bugzilla.novell.com/show_bug.cgi?id=820367 .
Shouldn’t happen if you stick to the shipped kernels… :wink:

I always use YAST GUI for management.
I DO have the Kernel upstream Repo enabled;

Upstream? Which upstream repo?
3.11 has been abandoned upstream some time in December I think. The current release is 3.16.1.

I needed it early on due to early 13.1 Bluetooth issues
I was getting a lot of updates, so locked on one that worked

uname -a
Linux PVE-LinuxSRV5 3.11.10-9.gdf9697b-desktop #1 SMP PREEMPT Wed Jan 8 15:41:04 UTC 2014 (df9697b) x86_64 x86_64 x86_64 GNU/Linux

Since then there have been 4! kernel updates for 13.1.

I would try to use the latest one from the standard update repo (3.11.10-27.1), and see whether your problem is fixed.
Maybe you don’t need that “upstream” kernel and repo at all any more?

Perhaps that messes with the purge service?

Yes. See above.

I see 3.11.10-21.1-x86_64 is now the latest in 13.1 Update repo; perhaps I should just switch to that

Yes, see above.

Until the update for purge-kernels in 13.1 is released, you have to remove the other kernels manually though.
Or just apply the patch from the bug report/make the corresponding changes to /sbin/purge-kernels yourself. It’s only a shell script, i.e. text file, anyway.

Although if you boot the standard kernel, those other kernels should get removed I think.
AFAIK, the problem only occurs if you actually run a kernel with the git hash (i.e. that .gdf9697b) in the version number when purge-kernels is called.

Remove the old kernels, and the menu will take care of itself.

Yast → Software Management

Search for “kernel”.

Click the “Versions” tab near the bottom.

Delete all but the most recent one or two kernels. To delete, click the entry in the versions tab. You might need to click twice to mark it for deletion, if the first click instead marks it for reinstall.

Sorry, I was using

http://download.opensuse.org/repositories/Kernel:/openSUSE-13.1/standard/

, had given it the name “upstream” when I originally configured Repos

Anyway, went back to

Linux PVE-LinuxSRV5 3.11.10-21-desktop #1 SMP PREEMPT Mon Jul 21 15:28:46 UTC 2014 (9a9565d) x86_64 x86_64 x86_64 GNU/Linux

from Update repo, and it DID clean up the older stuff.

All seems OK on reboot - THANKS

That repo has nothing to do with upstream.

That repo contains the latest openSUSE 13.1 kernel, as the name implies.
It is used to prepare the online updates AFAIK.

So you probably could have removed it in February already, that’s when the first update got released… :wink:

All seems OK on reboot - THANKS

You’re welcome.