Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I download and install packages on my Red Hat Enterprise Linux Server 6 machine using YUM package manager in command-line mode.

When I install apk files on my Android phone, they go to /data/app directory, I am wondering where RHEL6 keeps its installed rpm files?

share|improve this question

Yum maintains a cache of the RPMs it downloads here:

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

For example my box is Fedora 14, x86_64 architecture so I have the following:

$ 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

But the RPMs that get installed are basically like a zip or tar file. So the contents of these files get dumped into the system and RPM maintains a database of what packages it has installed. The RPM "database" is located in this directory:

$ 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

You can see where files get installed per each RPM with these commands.

what files are in an installed RPM

$ rpm -ql rpm

package info about a given 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.
share|improve this answer

The rpm files themselves are downloaded and then installed. Once these files are installed, they are tracked by the rpm database. To see where the files for a particular rpm were installed, you can run rpm -ql.


[z@localhost ~]# rpm -ql bash |head

Shows the first ten files installed by the bash rpm. That being said, rpms also contain pre and post scripts and some poorly built packages might drop files that wouldn't get tracked in the rpm database.

If that wasn't what you were asking, yum can cache rpms when downloading for an install. Try looking around in /var/cache/yum/ - but this only applies if you have keepcache=1 set in your /etc/yum.conf.

share|improve this answer
+1 to zje for mentioning about keepcache=1 configuration. If keepcache=0, then packages wont be present under /var/cache/yum/ – Binita Bharati Dec 22 '15 at 4:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.