8.4.7. Working with Yum Cache
$releaseverare Yum variables referring to base architecture of the system and the release version of Red Hat Enterprise Linux. Each configured repository has one subdirectory. For example, the directory
/var/cache/yum/$basearch/$releasever/development/packages/holds packages downloaded from the development repository. You can find the values for the $basearch and $releasever variables in the output of the
cachediroption in the
[main]section of the
/etc/yum.confconfiguration file. See Section 8.4, “Configuring Yum and Yum Repositories” for more information on configuring yum.
Enabling the Caches
keepcache = 1
Using yum in Cache-only Mode
--cacheonlycommand-line option. With this option, yum proceeds without checking any network repositories, and uses only cached files. In this mode, yum may only install packages that have been downloaded and cached by a previous operation.
Clearing the yum Caches
/var/cache/yum/directory. If you remove a package from the cache, you do not affect the copy of the software installed on your system. To remove all entries for currently enabled repositories from the cache, type the following as a
cleanmode depending on the type of cached data you want to remove. See Table 8.3, “Available
cleanoptions” for a complete list of available configuration options.
Table 8.3. Available
|expire-cache||eliminates time records of the metadata and mirrorlists download for each repository. This forces yum to revalidate the cache for each repository the next time it is used.|
|packages||eliminates any cached packages from the system|
|headers||eliminates all header files that previous versions of yum used for dependency resolution|
|metadata||eliminates all files that yum uses to determine the remote availability of packages. These metadata are downloaded again the next time yum is run.|
|dbcache||eliminates the sqlite cache used for faster access to metadata. Using this option will force yum to download the sqlite metadata the next time it is run. This does not apply for repositories that contain only .xml data, in that case, sqlite data are deleted but without subsequent download|
|rpmdb||eliminates any cached data from the local rpmdb|
|plugins||enabled plugins are forced to eliminate their cached data|
|all||removes all of the above|
expire-cacheoption is most preferred from the above list. In many cases, it is a sufficient and much faster replacement for