我相信我已经安装了多个使用相同 shell 命令运行的软件包。我知道其中一个,但我只隐约记得安装了另一个,因此无法卸载它。我相信它们会互相造成问题,因此我需要卸载我不记得的那个。有没有一种简单的方法可以找到使用某个 shell 命令调用哪个包?这是在 RHEL 6.5 上。
答案1
尝试:
yum whatprovides <command>
从man yum
:
provides or whatprovides
Is used to find out which package provides some feature or file.
Just use a specific name or a file-glob-syntax wildcards to list
the packages available or installed that provide that feature or
file.
例子:
yum whatprovides /bin/ls
coreutils-5.97-34.el5_8.1.x86_64 : The GNU core utilities: a set of tools
: commonly used in shell scripts
Repo : base
Matched from:
Filename : /bin/ls
coreutils-5.97-34.el5_8.1.x86_64 : The GNU core utilities: a set of tools
: commonly used in shell scripts
Repo : installed
Matched from:
Other : Provides-match: /bin/ls