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?


2 Answers 2


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.
  • 1
    gosh, it was so hard for me to understand! because as example you gave rpm ;) so, if you want to see, where are files installed for let's say java-11-openjdk-src package, you use rpm -ql java-11-openjdk-src ;)
    – Line
    Aug 29, 2019 at 12:09
  • 3
    @Line - sorry about that, RPM is a legit package as well. It's also safe b/c everyone has it, that's the main reason I picked it.
    – slm
    Aug 29, 2019 at 15:52
  • 1
    I understand, it was just confusing, because I didn't know that thing. Hope the above commend will help if anyone without that knowledge will take a look at this ;)
    – Line
    Aug 29, 2019 at 17:11

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.

  • +1 to zje for mentioning about keepcache=1 configuration. If keepcache=0, then packages wont be present under /var/cache/yum/ Dec 22, 2015 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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