How many kernels should I have

There was a Tumbleweed kernel update today (to 3.9.3-9). So now I have 5 kernels. Are there supposed to be that many?

It looks as if there is no deleting of old kernels. Perhaps that is due to something I am doing, or perhaps it is a bug.


Here’s what I am doing. I booted the 3.7.10-1.4 kernel to do the update, and I booted that one again immediately after the update when I expected cleanup to occur.

I noted that “/etc/zypp/zypp.conf” says that the latest, previous and running kernels are to be kept. Since I wanted 3.7.10-1.4 to be kept, I made sure that was running at the time. My assumption was that I would finish up with 3 kernels (3.7.10-1.4, 3.9.3-8 and 3.9.2-8). But I also seem to have 3.9.0-6 and 3.9.1-7.

As to why I want to keep 3.7.10-1.4 – that is the last signed kernel, so the last one that will work if I have secure-boot enabled.

Yes you can delete it using yast2
Just go to the yast2-software management and under the versions choose the kernel number that you want to delete by removing the check inside the box.

Yes, I know that. I’ve been deleting on another box where “/boot” is smallish.

I’m just wondering if they were supposed to auto-delete.

Take a look at this
openSUSE 12.3: Chapter 12. Installing Multiple Kernel Versions

AFAIK this is supposed to be done by purge-kernel.service on boot. Due to a bug in systemd’s default settings this was not enabled on 12.3 by default, so you might have to enable it manually:

systemctl enable purge-kernels.service

This just calls the script /sbin/purge-kernels on boot, which does the actual work then. See “/sbin/purge-kernels -h”.

Here’s what I am doing. I booted the 3.7.10-1.4 kernel to do the update, and I booted that one again immediately after the update when I expected cleanup to occur.

I noted that “/etc/zypp/zypp.conf” says that the latest, previous and running kernels are to be kept. Since I wanted 3.7.10-1.4 to be kept, I made sure that was running at the time. My assumption was that I would finish up with 3 kernels (3.7.10-1.4, 3.9.3-8 and 3.9.2-8). But I also seem to have 3.9.0-6 and 3.9.1-7.

Well, since purge-kernels deletes the unwanted kernels, “running” is the kernel that’s running when the kernels are deleted not when they are installed. If I understand you correctly, your config is not quite what you intend. I think you should explicitely add 3.7.10-1.4 to multiversion.kernels in /etc/zypp.conf, or just add “oldest” to the list…

Thanks for the suggestion.

I added 3.7.10-1.4 to the list.

I ran today’s updates, which installed kernel 3.9.3-10. Again, old kernels were not deleted even after a reboot.

I went into Yast, and deleted all but the older 3.7.10-1.4 and the two most recent.

I then rebooted again.

I then ran: “purge-kernels --test” to see what that would do. And it tells me:


# purge-kernels --test
/sbin/purge-kernels: Running kernel 3.9.3-10.g06ad9d8-x86_64/desktop not installed.
NOT removing any packages for flavor x86_64/desktop.
/sbin/purge-kernels: Nothing to do.

I don’t know why it is saying that the running kernel is not installed. For safety, I reinstalled that kernel, and rebooted again. And “purge-kernels --test” is still saying the same thing.

And then if I run “zypper -v dup -D” it tells me (among other things):


The following NEW packages are going to be installed:
  kernel-default-devel  3.7.10-1.1.1
  kernel-desktop        3.7.10-1.1.1
  kernel-desktop-devel  3.7.10-1.1.1
  kernel-devel          3.7.10-1.1.1
  kernel-syms           3.7.10-1.1.1
  kernel-xen-devel      3.7.10-1.1.1

So why does it want to reinstall 3.7.10-1.1. That makes no sense.

That hash value “g06ad9d8” seems to confuse purge-kernels.
There is a bugreport about this:
https://bugzilla.novell.com/show_bug.cgi?id=820367

And then if I run “zypper -v dup -D” it tells me (among other things):

The following NEW packages are going to be installed:
kernel-default-devel 3.7.10-1.1.1
kernel-desktop 3.7.10-1.1.1
kernel-desktop-devel 3.7.10-1.1.1
kernel-devel 3.7.10-1.1.1
kernel-syms 3.7.10-1.1.1
kernel-xen-devel 3.7.10-1.1.1

So why does it want to reinstall 3.7.10-1.1. That makes no sense.

Perhaps that’s a consequence of the above bug. If you let out the 3.9.3-10 kernel, zypper needs to install a kernel so that you have 3. And the only available one that’s not already installed is 3.7.10-1.1.1…
But that is just guessing of course.

Thanks. Yes, that seems to be what is happening. It might also help explain why I have so many kernels.

I tried a completely different guess. I reinstalled 3.7.10-1.4. And that seemed to fix the problem. Then I also reinstalled 3.9.3-10 so that the various symlinks would be set to the latest kernel. And the problem stayed fixed. That is, “zypper dup” now says nothing to do and does not want to install that older kernel.