yum

【yum】CentOS 上如何查询某个包是由哪个yum仓库提供的

2025-01-14  本文已影响0人  放纵不基

CentOS 上如何查询这个包是由哪个yum仓库提供的?

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)


# pip
pip     pip2    pip2.7

# which pip
/usr/bin/pip

# rpm -qf /usr/bin/pip
python2-pip-8.1.2-14.el7.noarch

# yum info python2-pip

Loaded plugins: fastestmirror, langpacks, versionlock
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
Installed Packages
Name        : python2-pip
Arch        : noarch
Version     : 8.1.2
Release     : 14.el7
Size        : 7.2 M
Repo        : installed
From repo   : epel
Summary     : A tool for installing and managing Python 2 packages
URL         : http://www.pip-installer.org
License     : MIT and BSD and ASL 2.0 and ISC and Python and (ASL 2.0 or BSD) and LGPLv2+
Description : Pip is a replacement for easy_install.  It uses mostly the
            : same techniques for finding packages, so packages that were made
            : easy_installable should be pip-installable as well.

在 CentOS 上,可以使用 yum 工具来查询某个包是由哪个仓库提供的。
对于你提到的 python2-pip 包,你可以使用以下命令来查找该包来源的仓库:

# yum list python2-pip

Loaded plugins: fastestmirror, langpacks, versionlock
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
Installed Packages
python2-pip.noarch                                                 8.1.2-14.el7                                                 @epel

此命令会列出 python2-pip 包的详细信息,并显示该包所在的仓库。

另外,你还可以使用以下命令来查看包的仓库来源:

# yum provides /usr/bin/pip

Loaded plugins: fastestmirror, langpacks, versionlock
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
python2-pip-8.1.2-14.el7.noarch : A tool for installing and managing Python 2 packages
Repo        : @epel
Matched from:
Filename    : /usr/bin/pip

这个命令会告诉你 /usr/bin/pip 这个文件属于哪个包,及其所在的仓库。

如果你希望更详细的信息,使用 rpm -qi 命令查看已安装包的详细信息,也可以看到仓库的信息,但 yum provides 通常是更直接的方式。

上一篇 下一篇

猜你喜欢

热点阅读