![有时,如果仅提供文件名,zypper 无法找到软件包](https://linux22.com/image/1612752/%E6%9C%89%E6%97%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%E4%BB%85%E6%8F%90%E4%BE%9B%E6%96%87%E4%BB%B6%E5%90%8D%EF%BC%8Czypper%20%E6%97%A0%E6%B3%95%E6%89%BE%E5%88%B0%E8%BD%AF%E4%BB%B6%E5%8C%85.png)
如果命令提供了完整路径,则会找到预期的包:
> zypper search --provides --match-exact /usr/sbin/update-ca-certificates
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
---+-----------------+-------------------------------------------------------+--------
i+ | ca-certificates | Utilities for system wide CA certificate installation | package
如果仅提供文件名则不然:
> zypper search --provides --match-exact update-ca-certificates
Loading repository data...
Reading installed packages...
No matching items found.
但它只适用于文件名,如下bash
所示:
> zypper search --provides --match-exact bash
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
--+------+----------------------------+--------
i | bash | The GNU Bourne-Again Shell | package
那么,这是一个错误吗?或者我只是错过了ca-certificates
通过文件名定位包的某些东西update-ca-certificates
?
答案1
来自zypper
手册:
-x, --match-exact
Searches for an exact name of the package.
寻找zypper
包裹名称。它也适用于精确的文件名(完整路径)。
你感到困惑,因为你认为通过指定狂欢 zypper
是寻找/usr/bin/bash
,但实际上zypper
是寻找包裹名字重击。