Answers:
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 -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 -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.
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
。
-ql java-11-openjdk-src
);