已安装的RPM到哪里去?


27

我在命令行模式下使用YUM软件包管理器在Red Hat Enterprise Linux Server 6机器上下载并安装了软件包。

当我在Android手机上安装apk文件时,它们会进入目录,我想知道RHEL6将其安装的rpm文件保存在哪里?/data/app

Answers:


26

Yum会保留在此处下载的RPM的缓存:

/var/cache/yum/<you architecture>/<OS version>/

例如,我的盒子是Fedora 14,x86_64体系结构,因此我具有以下内容:

$ ls /var/cache/yum/x86_64/14/
adobe-linux-i386        lamolabs                                  rpmfusion-nonfree
adobe-linux-x86_64      lamolabs-noarch                           rpmfusion-nonfree-debuginfo
Dropbox                 nautilus-flickr-uploader                  rpmfusion-nonfree-rawhide-debuginfo
fedora                  qm                                        rpmfusion-nonfree-source
...
...

但是安装的RPM基本上就像一个zip或tar文件。因此,这些文件的内容被转储到系统中,并且RPM维护一个数据库,其中包含已安装的软件包。RPM“数据库”位于以下目录中:

$ ls /var/lib/rpm
Basenames     __db.002  Dirnames     Installtid    Packages        Pubkeys         Sha1header
Conflictname  __db.003  Filedigests  Name          Providename     Requirename     Sigmd5
__db.001      __db.004  Group        Obsoletename  Provideversion  Requireversion  Triggername

您可以使用这些命令查看每个RPM的文件安装位置。

已安装的RPM中有哪些文件

$ rpm -ql rpm
/bin/rpm
/etc/rpm
/usr/bin/rpm2cpio
/usr/bin/rpmdb
/usr/bin/rpmquery
/usr/bin/rpmsign
/usr/bin/rpmverify
/usr/lib/rpm
/usr/lib/rpm/macros
/usr/lib/rpm/platform
/usr/lib/rpm/platform/amd64-linux
...
...

有关给定RPM的包装信息

$ rpm -qi rpm
Name        : rpm                          Relocations: (not relocatable)
Version     : 4.8.1                             Vendor: Fedora Project
Release     : 7.fc14                        Build Date: Tue 04 Oct 2011 03:49:08 AM EDT
Install Date: Tue 25 Oct 2011 09:36:34 AM EDT      Build Host: x86-05.phx2.fedoraproject.org
Group       : System Environment/Base       Source RPM: rpm-4.8.1-7.fc14.src.rpm
Size        : 2035701                          License: GPLv2+
Signature   : RSA/SHA256, Tue 04 Oct 2011 12:14:48 PM EDT, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.rpm.org/
Summary     : The RPM package management system
Description :
The RPM Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.

天哪,我很难理解!因为比如你给转;),所以,如果你想看到的,安装在哪里比方说,文件的Java-11的OpenJDK-SRC包,你用rpm -ql java-11-openjdk-src);
线

1
@Line-对此感到抱歉,RPM也是合法软件包。所有人都拥有它也是安全的,这就是我选择它的主要原因。
slm

1
我知道,这只是令人困惑,因为我不知道那件事。希望以上表彰会帮助,如果没有这些知识的人都会来看看这个;)
在线

12

rpm文件本身已下载然后安装。安装这些文件后,rpm数据库将跟踪它们。要查看特定rpm文件的安装位置,可以运行rpm -ql

例如

[z@localhost ~]# rpm -ql bash |head
/bin/bash
/bin/sh
/etc/skel/.bash_logout
/etc/skel/.bash_profile
/etc/skel/.bashrc
/usr/bin/bashbug-64
/usr/share/doc/bash-4.1.2/COPYING
/usr/share/info/bash.info.gz
/usr/share/locale/af/LC_MESSAGES/bash.mo
/usr/share/locale/bg/LC_MESSAGES/bash.mo

显示bash rpm安装的前十个文件。话虽如此,rpm也包含前置和后置脚本,并且某些构建欠佳的软件包可能会丢弃在rpm数据库中无法跟踪的文件。

如果不是您所要的,yum可以在下载安装时缓存rpm。尝试环顾四周/var/cache/yum/-但这仅在您keepcache=1设置了时适用/etc/yum.conf


+1到zje以提及关于keepcache = 1的配置。如果keepcache = 0,则软件包不会出现在/ var / cache / yum /下
Binita Bharati 2015年
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.