質問: 実行可能ファイル、ファイル、またはライブラリが属するパッケージを見つけることができるコマンドがCentOSにあるかどうか知りたいのですが。たとえば、どのパッケージに / usr / bin / sha256sumが含まれているかを確認するにはどうすればよいですか。 実行可能ファイルまたは/usr/lib64/libnss3.soを含むパッケージ ライブラリファイル。
回答:
rpm -qfを使用できます 特定の実行可能ファイル、ファイル、またはライブラリが属するパッケージを検索するコマンド。
形式:
$ rpm -qf <executable/file/library>
特定の実行可能ファイルを含むパッケージを見つける方法
$ rpm -qf /usr/bin/sha256sum coreutils-8.4-37.el6_7.3.x86_64
ライブラリが属するパッケージを見つける方法
$ rpm -qf /usr/lib64/libnss3.so nss-3.19.1-5.el6_7.x86_64
ファイルが属するパッケージを見つける方法
$ rpm -qf /etc/httpd/conf/httpd.conf httpd-2.2.15-47.el6.centos.1.x86_64
バージョン情報なしでパッケージ名のみを一覧表示する方法
–queryformatを使用できます 以下に示すオプション:
$ rpm -qf /usr/bin/sha256sum --queryformat '%{NAME}\n' coreutils
実行可能ファイルを提供する利用可能なすべてのリポジトリパッケージを見つける方法またはファイルまたはライブラリ?
$ yum provides /usr/bin/sha1sum Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, : security Loading mirror speeds from cached hostfile * base: dallas.tx.mirror.xygenhosting.com * epel: mirror.compevo.com * epel-debuginfo: fedora-epel.mirror.lstn.net * extras: repos.dfw.quadranet.com * updates: pubmirrors.dal.corespace.com coreutils-8.4-37.el6.x86_64 : A set of basic GNU tools commonly used in shell : scripts Repo : base Matched from: Filename : /usr/bin/sha1sum coreutils-8.4-37.el6_7.3.x86_64 : A set of basic GNU tools commonly used in : shell scripts Repo : updates Matched from: Filename : /usr/bin/sha1sum coreutils-8.4-37.el6_7.3.x86_64 : A set of basic GNU tools commonly used in : shell scripts Repo : installed Matched from: Other : Provides-match: /usr/bin/sha1sum
それだけです。
CentOSのソースからPython3.5とPython-pipをコンパイルしてインストールする方法
Yumを使用してCentOS/RedHatサーバーでPHP5.xをPHP7.0にアップグレードする