我正在尝试从 openSUSE 中删除旧内核。openSUSE 版本是 Tumbleweed (20191128),旧内核是 5.1.16。
Zypper 的联机帮助页在这里。看起来 Zypper 支持通配符(如果我正确解析了联机帮助页),但我没有得到正确的语法。我不确定如何告诉包管理器在删除期间匹配通配符。
如何告诉 Zypper 删除匹配的包*5.1.16*
?
> ls /boot/
boot.readme sysctl.conf-5.1.16-1-default
config-5.1.16-1-default sysctl.conf-5.3.12-1-default
config-5.3.12-1-default System.map-5.1.16-1-default
grub2 System.map-5.3.12-1-default
initrd vmlinux-5.1.16-1-default.gz
initrd-5.1.16-1-default vmlinux-5.3.12-1-default.gz
initrd-5.3.12-1-default vmlinuz
symvers-5.1.16-1-default.gz vmlinuz-5.1.16-1-default
symvers-5.3.12-1-default.gz vmlinuz-5.3.12-1-default
> sudo zypper remove *5.1.16*
Loading repository data...
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
Reading installed packages...
'*5.1.16*' not found in package names. Trying capabilities.
No provider of '*5.1.16*' found.
Resolving package dependencies...
Nothing to do.
> sudo zypper remove '*5.1.16*'
Loading repository data...
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
Reading installed packages...
'*5.1.16*' not found in package names. Trying capabilities.
No provider of '*5.1.16*' found.
Resolving package dependencies...
Nothing to do.
通配符仅适用于包名称,不适用于版本号:
但是,您可以执行以下操作: