tsh*_*ang 72 fedora packaging filenames
在 Debian 系列操作系统中,dpkg --search /bin/ls给出:
coreutils: /bin/ls
Run Code Online (Sandbox Code Playgroud)
也就是说,该文件/bin/ls属于名为coreutils的 Debian 软件包。(如果您对包含未安装文件的包感兴趣,请参阅此帖子)
Fedora 的等价物是什么?
eld*_*his 90
您可以使用rpm -qf /bin/ls来确定您安装的版本属于哪个软件包:
[09:46:58] ~ $ rpm -qf /bin/ls
coreutils-8.5-7.fc14.i686
[09:47:01] ~ $
Run Code Online (Sandbox Code Playgroud)
更新:根据您的评论,如果您只想要包的名称(我刚刚有机会测试),以下应该可以工作:
[01:52:49] ~ $ rpm -qf /bin/ls --queryformat '%{NAME}\n'
coreutils
[01:52:52] ~ $
Run Code Online (Sandbox Code Playgroud)
您还可以使用dnf provides /bin/ls获取将提供该文件的所有可用存储库包的列表:
# dnf provides /bin/ls
Last metadata expiration check: 0:17:06 ago on Tue Jun 27 18:04:08 2017.
coreutils-8.25-17.fc25.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo : @System
coreutils-8.25-17.fc25.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo : updates
coreutils-8.25-14.fc25.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo : fedora
Run Code Online (Sandbox Code Playgroud)