Now we are getting somewhere! Thanks for this. It will do what I need, but there were some interesting (at least to me) observations while playing with this some more.
First, the solver is noisier and needs more help when using
sudo zypper al 'kernel-de* >= 6.2.0'
Instead of just answering the questions about the two kmp packages for ZFS and VirtualBox I have to answer 3 more for the kernel and kernel devel packages (including a noarch one?).
foo@localhost:~> uname -r
6.1.12-1-default
foo@localhost:~> zypper ll
# | Name | Type | Repository | Comment
--+---------------------+---------+------------+--------
1 | kernel-de* >= 6.2.0 | package | (any) |
foo@localhost:~> sudo zypper dup
[sudo] password for root:
Loading repository data...
Reading installed packages...
Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Computing distribution upgrade...
3 Problems:
Problem: problem with the installed kernel-default-6.1.12-1.1.x86_64
Problem: problem with the installed kernel-default-devel-6.1.12-1.1.x86_64
Problem: problem with the installed kernel-devel-6.1.12-1.1.noarch
Problem: problem with the installed kernel-default-6.1.12-1.1.x86_64
Solution 1: Following actions will be done:
deinstallation of kernel-default-6.1.12-1.1.x86_64
deinstallation of virtualbox-kmp-default-7.0.6_k6.1.12_1-3.2.x86_64
deinstallation of zfs-kmp-default-2.1.9_k6.1.12_1-1.36.x86_64
deinstallation of virtualbox-7.0.6-5.1.x86_64
Solution 2: keep obsolete kernel-default-6.1.12-1.1.x86_64
Solution 3: remove lock to allow installation of kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
Choose from above solutions by number or skip, retry or cancel [1/2/3/s/r/c/d/?] (c): 2
Problem: problem with the installed kernel-default-devel-6.1.12-1.1.x86_64
Solution 1: Following actions will be done:
remove lock to allow installation of kernel-default-devel-6.2.6-1.1.i586[download.opensuse.org-oss]
install kernel-default-devel-6.2.6-1.1.i586 despite the inferior architecture
Solution 2: deinstallation of kernel-default-devel-6.1.12-1.1.x86_64
Solution 3: keep obsolete kernel-default-devel-6.1.12-1.1.x86_64
Solution 4: remove lock to allow installation of kernel-default-devel-6.2.6-1.1.x86_64[download.opensuse.org-oss]
Choose from above solutions by number or skip, retry or cancel [1/2/3/4/s/r/c/d/?] (c): 3
Problem: problem with the installed kernel-devel-6.1.12-1.1.noarch
Solution 1: deinstallation of kernel-devel-6.1.12-1.1.noarch
Solution 2: keep obsolete kernel-devel-6.1.12-1.1.noarch
Solution 3: remove lock to allow installation of kernel-devel-6.2.6-1.1.noarch[download.opensuse.org-oss]
Choose from above solutions by number or skip, retry or cancel [1/2/3/s/r/c/d/?] (c): 2
Resolving dependencies...
Computing distribution upgrade...
Problem: the to be installed zfs-kmp-default-2.1.9_k6.2.6_1-1.61.x86_64 requires 'kernel-uname-r = 6.2.6-1-default', but this requirement cannot be provided
not installable providers: kernel-default-6.2.6-1.1.i586[download.opensuse.org-oss]
kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 1: Following actions will be done:
remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
remove lock to allow removal of kernel-default-devel-6.1.12-1.1.x86_64
Solution 2: deinstallation of zfs-kmp-default-2.1.9_k6.1.12_1-1.36.x86_64
Solution 3: keep obsolete zfs-kmp-default-2.1.9_k6.1.12_1-1.36.x86_64
Solution 4: remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 5: remove lock to allow installation of kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
Solution 6: break zfs-kmp-default-2.1.9_k6.2.6_1-1.61.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/3/4/5/6/c/d/?] (c): 3
Resolving dependencies...
Computing distribution upgrade...
Problem: the to be installed virtualbox-kmp-default-7.0.6_k6.2.6_1-5.4.x86_64 requires 'kernel-uname-r = 6.2.6-1-default', but this requirement cannot be provided
not installable providers: kernel-default-6.2.6-1.1.i586[download.opensuse.org-oss]
kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 1: Following actions will be done:
remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
remove lock to allow removal of kernel-default-devel-6.1.12-1.1.x86_64
Solution 2: Following actions will be done:
deinstallation of virtualbox-kmp-default-7.0.6_k6.1.12_1-3.2.x86_64
deinstallation of virtualbox-7.0.6-5.1.x86_64
Solution 3: keep obsolete virtualbox-kmp-default-7.0.6_k6.1.12_1-3.2.x86_64
Solution 4: remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 5: remove lock to allow installation of kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
Solution 6: break virtualbox-kmp-default-7.0.6_k6.2.6_1-5.4.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/3/4/5/6/c/d/?] (c): 3
Resolving dependencies...
Computing distribution upgrade...
The following 11 items are locked and will not be changed by any action:
Available:
kernel-debug kernel-debug-devel kernel-debug-vdso kernel-default-base kernel-default-base-rebuild kernel-default-vdso
Installed:
kernel-default kernel-default-devel kernel-devel virtualbox-kmp-default zfs-kmp-default
Nothing to do.
Here it is with using sudo zypper al kernel-de*
foo@localhost:~> zypper ll
# | Name | Type | Repository | Comment
--+------------+---------+------------+--------
1 | kernel-de* | package | (any) |
foo@localhost:~> sudo zypper dup
Loading repository data...
Reading installed packages...
Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Computing distribution upgrade...
Problem: the to be installed zfs-kmp-default-2.1.9_k6.2.6_1-1.61.x86_64 requires 'kernel-uname-r = 6.2.6-1-default', but this requirement cannot be provided
not installable providers: kernel-default-6.2.6-1.1.i586[download.opensuse.org-oss]
kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 1: Following actions will be done:
remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
remove lock to allow removal of kernel-default-devel-6.1.12-1.1.x86_64
Solution 2: deinstallation of zfs-kmp-default-2.1.9_k6.1.12_1-1.36.x86_64
Solution 3: keep obsolete zfs-kmp-default-2.1.9_k6.1.12_1-1.36.x86_64
Solution 4: remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 5: remove lock to allow installation of kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
Solution 6: break zfs-kmp-default-2.1.9_k6.2.6_1-1.61.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/3/4/5/6/c/d/?] (c): 3
Resolving dependencies...
Computing distribution upgrade...
Problem: the to be installed virtualbox-kmp-default-7.0.6_k6.2.6_1-5.4.x86_64 requires 'kernel-uname-r = 6.2.6-1-default', but this requirement cannot be provided
not installable providers: kernel-default-6.2.6-1.1.i586[download.opensuse.org-oss]
kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 1: Following actions will be done:
remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.i586[download.opensuse.org-oss]
remove lock to allow removal of kernel-default-devel-6.1.12-1.1.x86_64
Solution 2: Following actions will be done:
deinstallation of virtualbox-kmp-default-7.0.6_k6.1.12_1-3.2.x86_64
deinstallation of virtualbox-7.0.6-5.1.x86_64
Solution 3: keep obsolete virtualbox-kmp-default-7.0.6_k6.1.12_1-3.2.x86_64
Solution 4: remove lock to allow installation of kernel-default-base-6.2.6-1.1.25.29.x86_64[download.opensuse.org-oss]
Solution 5: remove lock to allow installation of kernel-default-6.2.6-1.1.x86_64[download.opensuse.org-oss]
Solution 6: break virtualbox-kmp-default-7.0.6_k6.2.6_1-5.4.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/3/4/5/6/c/d/?] (c): 3
Resolving dependencies...
Computing distribution upgrade...
The following 11 items are locked and will not be changed by any action:
Available:
kernel-debug kernel-debug-devel kernel-debug-vdso kernel-default-base kernel-default-base-rebuild kernel-default-vdso
Installed:
kernel-default kernel-default-devel kernel-devel virtualbox-kmp-default zfs-kmp-default
Nothing to do.
I could always just switch to the latter once a new major version comes out. Ideally I’d be able to pass in something during the dup to default to “keep obsolete”. I played with --solver-focus Installed
but that doesn’t do what I want.
The second issue is that the locks never seem to match on installed packages. The above work by the glob matching a package from the repositories. But if I do something like trying to keep the exact installed version, it doesn’t match the installed package and will upgrade to 6.2.x. E.g. one of…
sudo zypper al 'kernel-de* = 6.1.12'
sudo zypper al 'kernel-de* = 6.1.12-1.1'
sudo zypper al 'kernel-default = 6.1.12'
sudo zypper al kernel-default=6.1.12
And in a similar way, your suggestion but using less than or equal seems like it should work.
sudo zypper al 'kernel-de* <= 6.2.0'
That should match the installed 6.1.12 package and hold it, but it doesn’t.
Anyway, thanks for all the help. If anyone has a way to force the solver to use the ‘keep obsolete’ option that would be great.