Cleaning the yum cache – yum clean options

YUM - Yellowdog Updater Modifier

yum is an interactive, rpm based, package manager. It performs system updates, installation of new packages, removal of old packages, queries on the installed and/or available packages, and more.

Note the first bit below, yum clean all only cleans files for currently enabled repos. To really clean all you need to use

yum clean all --enablerepo='*'

From the yum man page:


The following are the ways which you can invoke yum in clean mode. Note that “all files” in the commands below means “all
files in currently enabled repositories”. If you want to also clean any (temporarily) disabled repositories you need to
use –enablerepo=’*’ option.

yum clean expire-cache

Eliminate the local data saying when the metadata and mirrorlists were downloaded for each repo. This means yum will revalidate the cache for each repo. next time it is used. However if the cache is still valid, nothing significant was deleted.

yum clean packages

Eliminate any cached packages from the system. Note that packages are not automatically deleted after they are

yum clean headers

Eliminate all of the header files, which old versions of yum used for dependency resolution.

yum clean metadata

Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will
force yum to download all the metadata the next time it is run.

yum clean dbcache

Eliminate 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, or recreate the sqlite metadata if using an older repo.

yum clean rpmdb

Eliminate any cached data from the local rpmdb.

yum clean plugins

Tell any enabled plugins to eliminate their cached data.

yum clean all

Does all of the above.


One thought on “Cleaning the yum cache – yum clean options”

Leave a Reply

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