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:
#1 Best Overall
- Used Book in Good Condition
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.
Rank #2
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:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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
Rank #4
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.
Quick Recap
Best Value
- 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
- Check whether the historical Yum cache exists:
ls -lah /var/cache/yum/. - Search that cache for archives:
find /var/cache/yum -type f -name '*.rpm' 2>/dev/null. - Check the RPM database directory:
ls -lah /var/lib/rpm/. This confirms database files, not downloaded archives. - Review
cachedirandkeepcachein the active Yum configuration. - 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.




