How to disable the fastestmirror yum plugin in CentOS 7 Linux?

Posted on

How to disable the fastmirror yum plugin in CentOS 7 Linux?


The fastestmirror function of yum is provided by the package `yum-plugin-fastestmirror`. However, because `yum` depends on it, the `yum-plugin-fastestmirror` package can not be removed. If you try to remove it, `yum` will report failures like.

# yum remove yum-plugin-fastestmirror
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-fastestmirror.noarch 0:1.1.31-50.el7 will be erased
--> Processing Dependency: yum-plugin-fastestmirror for package: yum-3.4.3-161.el7.centos.noarch
--> Running transaction check
---> Package yum.noarch 0:3.4.3-161.el7.centos will be erased
--> Processing Dependency: yum >= 3.4.3-143 for package: yum-utils-1.1.31-50.el7.noarch
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be erased
--> Finished Dependency Resolution
Error: Trying to remove "yum", which is protected

Don’t be panic yet. Although it can not be removed, it can be disabled. The fastedmirror plugin function can be controlled by the configuration file at

/etc/yum/pluginconf.d/fastestmirror.conf

One example is as follows.

[main]
enabled=1
verbose=0
always_print_best_host = true
socket_timeout=3
#  Relative paths are relative to the cachedir (and so works for users as well
# as root).
hostfilepath=timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook
#include_only=.nl,.de,.uk,.ie

The enabled option controls whether the plugin is enabled. To disable it, just replace the line

enabled=1

to

enabled=1

Then the fastestmirror plugin will be disabled.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Related Posts