如何找到yum安装的软件包?


1

我使用yum list php-imap列出php-imap:

# yum list php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * epel: ftp.cuhk.edu.hk
 * extras: mirrors.zju.edu.cn
 * updates: mirrors.zju.edu.cn
 * webtatic: sp.repo.webtatic.com
Installed Packages
php-imap.x86_64                        5.4.16-7.el7                        @epel

但是如何找到它的位置?我知道我可以用它find / -name php-imap来搜索,但是它很长一段时间,甚至命令都没有反应性。


在我的CentOS 7中,该/var/tmp/目录为空。并列出/var/cache/yum/x86_64/7/以下内容:

base epel extras mysql56-community mysql-connectors-community mysql-tools-community timedhosts timedhosts.txt updates webtatic. 

没有php-imap

Answers:


1

如果您想知道rpm文件在哪里,则取决于您的yum配置,您的系统可能保留也可能不保留它。检查“ /etc/yum.conf”(不确定在所有系统上的正确位置,但在我的Centos框上,这是正确的位置)上的“ cachedir =”行,这将告诉您rpms高速缓存的位置。例如:

grep cachedir /etc/yum.conf 

我的系统说/ var / cache / yum / $ basearch / $ releasevar

在同一文件中,如果包括keepcache = 0,则系统将不保存rpm。将此更改为keepcache = 1可使它们保持存在。根据您的存储空间,您可能需要不时地清理它。

如果您想知道实际软件在系统上的位置,请执行以下操作:

rpm -qa | grep php-imap

然后从结果中获取包名称(看起来可能是php-imap.x86_64),然后执行此操作

rpm -q --filesbypkg <package full name here>

3
这对于使用rpmnot 安装的软件包是正确的yum

yum使用与相同的RPM安装数据库yum,因此查询命令仍然可以使用。
telcoM

2

鉴于您的问题是有关使用所安装的软件包的yum,那么您必须检查选项infolist“子标记”。根据百胜男人的说法:

       info           Display details about a package or group of packages 
       list   Is used to list various information about available packages;

        LIST OPTIONS
       The following are the ways which you can invoke yum in list mode.  Note that all list commands include information on the version of the package.

       OUTPUT

              The format of the output of yum list is:

              name.arch [epoch:]version-release  repo or @installed-from-repo

              Note that if the repo cannot be determined, "installed" is printed instead.

       yum list [all | glob_exp1] [glob_exp2] [...]
              List all available and installed packages.

       yum list available [glob_exp1] [...]
              List all packages in the yum repositories available to be installed.

       yum list updates [glob_exp1] [...]
              List all packages with updates available in the yum repositories.

       yum list installed [glob_exp1] [...]
              List the packages specified by args.  If an argument does not match the name of an available package, it is assumed to be a shell-style glob and any matches are printed.

       yum list extras [glob_exp1] [...]
              List the packages installed on the system that are not available in any yum repository listed in the config file.

       yum list distro-extras [glob_exp1] [...]
              List the packages installed on the system that are not available, by name, in any yum repository listed in the config file.

       yum list obsoletes [glob_exp1] [...]
              List the packages installed on the system that are obsoleted by packages in any yum repository listed in the config file.

       yum list recent
              List packages recently added into the repositories. This is often not helpful, but what you may really want to use is "yum list-updateinfo new" from the security yum plugin.

另外,已安装软件包的路径取决于您的系统设置:

在Centos7中

/var/tmp/yum-root-xxxxx/ 

要么

/var/tmp/yum-username-xxxxx/

要么

/var/cache/yum/x86_64/7/program_name/packages/

在RHEL中,文件存储在

/var/cache/yum/x86_64/6Server/rhel-6-server-rpms/packages/

在我的CentOS 7中,该/var/tmp/目录为空。并列出/var/cache/yum/x86_64/7/以下内容:base epel extras mysql56-community mysql-connectors-community mysql-tools-community timedhosts timedhosts.txt updates webtatic。没有php-imap。
fanhualuojin154873 '18

@ fanhualuojin154873。请在上方查看我的修改。可能是您的系统配置为在安装后删除软件包。上面的答复是针对rpm您的问题所安装的软件包的yum

yum并非独立工具,而是rpm
telcoM
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.