AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 470266
Accepted
fanhualuojin154873
fanhualuojin154873
Asked: 2018-09-21 04:44:39 +0800 CST2018-09-21 04:44:39 +0800 CST 2018-09-21 04:44:39 +0800 CST

如何定位 yum 安装的软件包?

  • 772

我使用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。

yum
  • 2 2 个回答
  • 18700 Views

2 个回答

  • Voted
  1. Best Answer
    Patrick Taylor
    2018-09-21T22:57:03+08:002018-09-21T22:57:03+08:00

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

    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>
    
    • 4
  2. user88036
    2018-09-21T05:10:57+08:002018-09-21T05:10:57+08:00

    鉴于您的问题是关于使用 安装的软件包yum,那么您必须检查选项info和list“子标志”。根据Yum man:

           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/
    
    • 2

相关问题

  • yum install 下载速度很慢

  • 升级以前安装的带有前缀的 rpm 时,如何确保使用相同的前缀?

  • 为什么删除 npm 意味着在 CentOS 上也删除 nodejs?

  • yum + 解压存档失败

  • 可以安装软件包但 yum 或 rpm 命令看不到吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve