CentOS / RHEL : How to prevent disabled repositories from being downloaded into the yum cache

Question: How to prevent disabled repositories from being downloaded into the yum cache

Answer:

Yum does not fetch content from disabled repositories, but the yum cache may still hold a record of these repositories. The command “yum clean all” does not try to remove content from disabled repositories.

So, to entirely get rid of them, use

# rm -rf /var/cache/yum/*
Related Post