October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

Where Are RPM Packages Stored in CentOS? Cache, Database, and Configuration

Downloaded RPM archives on documented Yum-based CentOS systems normally reside under /var/cache/yum/$basearch/$releasever/packages/, while installed-package records are kept separately under /var/lib/rpm/. Cache cleanup and configuration can change what you find.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On Yum-based CentOS systems, downloaded .rpm files are normally stored in the Yum cache at /var/cache/yum/$basearch/$releasever/packages/. The exact path depends on the system architecture, release variables, repositories, and local configuration. This cache is separate from the RPM database in /var/lib/rpm/.

Where Yum stores downloaded RPM files

The documented Yum-era default is:

/var/cache/yum/$basearch/$releasever/packages/

$basearch represents the system architecture and $releasever represents the CentOS release value. Each enabled repository can have its own subdirectory beneath the Yum cache.

For example, an x86_64 system may contain repository-specific directories below /var/cache/yum/. Do not treat one expanded example path as universal: the variables and repository layout are resolved by the package manager.

Cache versus RPM database

What you need Where to look What it contains
Downloaded installer archive /var/cache/yum/$basearch/$releasever/packages/ on the documented Yum default Cached .rpm package files, when retained
Installed-package records /var/lib/rpm/ RPM database information about installed packages
Files installed by a package The paths declared by that package Programs, libraries, configuration files, documentation, and other payload files

The RPM database is not a backup copy of the original RPM archives. To list the files belonging to an installed package, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

rpm -ql package_name

To identify which installed package owns a particular absolute path, run:

rpm -qf /absolute/path

Why the expected cache directory may be empty

Yum cleaned the download after installation

Yum documentation for older Yum-based systems states that downloaded data no longer needed after a successful operation is removed by default. Therefore, an RPM can be installed even though its archive is no longer in the cache.

Cache retention is disabled

To retain downloaded packages on systems using the documented Yum configuration, set keepcache=1 in the [main] section of /etc/yum.conf. Existing files removed before this change cannot be recovered from the cache.

The cache directory was changed

Yum’s cache location is configurable with the cachedir setting. Inspect the active configuration instead of assuming the historical default:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

grep -R "^[[:space:]]*cachedir|^[[:space:]]*keepcache" /etc/yum.conf /etc/yum.repos.d 2>/dev/null

Also search the configured cache root directly:

find /var/cache/yum -type f -name '*.rpm' 2>/dev/null

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

CentOS version and package-manager differences

The concrete cache path above is the documented default for RHEL 7 Yum and is a useful reference for corresponding Yum-based CentOS releases. The cleanup and keepcache behavior comes from RHEL 6 Yum documentation. These references do not establish that every CentOS release, CentOS Stream version, or DNF-based installation uses exactly the same path.

On an individual machine, first determine which package manager is active and inspect its configuration and cache directories. DNF-based systems can use different cache layouts and policies, so do not infer their behavior solely from the historical Yum path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
CentOs Linux lover T-Shirt with tagline Open Source Os tee T-Shirt
  • This tee is great present. Show your passion for this mindset with this CentOs Shirt! It is an open source Linux distribution which focuses more on stability. You can give this Tee as a gift for young or men and girl.
  • This tee theme with CentOs Logo. Gift idea for friends, co-workers, hackers, geeks, programmers, computer geniuses and sys admins. Furthermore for Christmas, birthday or Father's Day for young or men and girl.
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem

Quick checks

  1. Check whether the historical Yum cache exists: ls -lah /var/cache/yum/.
  2. Search that cache for archives: find /var/cache/yum -type f -name '*.rpm' 2>/dev/null.
  3. Check the RPM database directory: ls -lah /var/lib/rpm/. This confirms database files, not downloaded archives.
  4. Review cachedir and keepcache in the active Yum configuration.
  5. If no archive is present, download the package again and choose a destination explicitly with the package manager’s download-only facilities rather than relying on a retained cache.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.