Zypper rm behaviour.

Hello.
I recently run into problems when updating the nvidia driver.

I use a script to do the job.
At some point, I verify if a package is installed (drm-kmp-default).
It seems that if the package is not installed, zypper want to delete the kernel.

I did not pay attention to the zypper message, and type return to continue. Then zypper removed the kernel.

Here is a screen copy :

.
.
zypper se -s drm-kmp-default
Loading repository data...
Reading installed packages...

S | Name            | Type    | Version              | Arch   | Repository
--+-----------------+---------+----------------------+--------+--------------------------
  | drm-kmp-default | package | 4.9.33_k4.4.79_4-5.2 | x86_64 | openSUSE-Leap-42.3-Update
  | drm-kmp-default | package | 4.9.33_k4.4.76_1-3.2 | x86_64 | openSUSE-Leap-42.3-Oss
.
.
.
.
zypper rm drm-kmp-default
Loading repository data...
Reading installed packages...
'drm-kmp-default' not found in package names. Trying capabilities.
Resolving package dependencies...

The following 2 packages are going to be REMOVED:
  kernel-default-4.4.76-1.1 kernel-default-4.4.104-39.1

2 packages to remove.
After the operation, 470,7 MiB will be freed.
Continue? [y/n/...? shows all options] (y):

Any comment is welcome.

That looks like old kernels being removed, nothing else AFAICS

That’s because the kernel packages do provide drm-kmp-default as well, because they do of course contain the drm kernel modules (just in a different version):

wolfi@linux-lf90:~/Desktop> rpm -q --provides kernel-default|grep drm-kmp
drm-kmp = 3.7_3.1
drm-kmp-default = 3.7_3.1
drm-kmp = 3.7_3.1
drm-kmp-default = 3.7_3.1

As the package drm-kmp-default is not installed, zypper looks for other provides and finds them in the kernel packages.

Why are you trying to uninstall the package drm-kmp-default if it’s not installed anyway?

If at all, specify a version like zypper rm “drm-kmp-default>=4.9”, or use “rpm -e drm-kmp-default” (rpm -e only uninstalls real packages I think).

Hi,

If you’re looking for packages that are installed, add the i flag.

zypper se -si drm-kmp-default

Remove the packages name, then it should show you everything that is installed.

zypper se -si

One last thing since it the packages are installed IMO refreshing the repos should not be done. Unless of course you really want to :slight_smile:
so one more flag.

zypper --no-refresh se -si

Ok.

What if I add --name ?
I have tested. Zypper don’t try to remove something else

zypper rm  --name drm-kmp-default

When installing the proprietary nvidia driver one must uninstall the drm-kmp-default package.
In my big innocence, I found simpler (doubtless too simple) to use the same script. Whether it is for a first installation, a re-installation, or an update with a new driver.
So removing a package which is not installed would not be a problem (Only if the script is not buggy ;))

Ok. Thank you

Perhaps now.
But 2 months ago, when I did an update of the nvidia driver, my script has removed the running kernel.
I had to open a thread for helps ( Broken system : unable to boot - Question 4 - Install/Boot/Login - openSUSE Forums )

Should also work, I suppose.

When installing the proprietary nvidia driver one must uninstall the drm-kmp-default package.

But only if it is installed.

You could also lock it to prevent accidental installation in the first place.

You could also use the rpm packages from the nvidia repo, they take care of this as well, and will even get updated automatically when you update your system.

But whatever. That’s your decision.