| |

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

Disabling fastestmirror in CentOS/RHEL systems

The fastestmirror plugin automatically selects the fastest package mirror for your system. While useful, you might want to disable it if you’re experiencing slow mirror detection, prefer a specific mirror, or troubleshoot package manager issues.

The plugin is provided by yum-plugin-fastestmirror (on older EL7 systems) or as part of DNF’s core functionality (EL8+). Unlike older versions, modern systems don’t allow direct removal of this package due to dependency chains.

Check your system

First, identify what package manager your system uses:

cat /etc/os-release | grep VERSION_ID
  • EL7/CentOS 7: Uses yum with plugin architecture
  • EL8+/CentOS Stream 8+/Rocky/Alma: Uses DNF with modular plugin system
  • Fedora 38+: Uses DNF5

Disabling on EL7 (yum)

The fastestmirror plugin reads configuration from /etc/yum/pluginconf.d/fastestmirror.conf. View the current settings:

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

You’ll see output similar to:

[main]
enabled=1
verbose=0
always_print_best_host=true
socket_timeout=3
hostfilepath=timedhosts.txt
maxhostfileage=10
maxthreads=15

To disable the plugin, change enabled=1 to enabled=0:

sudo sed -i 's/^enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf

Verify the change:

grep "^enabled" /etc/yum/pluginconf.d/fastestmirror.conf

Disabling on EL8+ (DNF)

Modern DNF versions handle mirror selection differently. If you want to disable fastest mirror detection, edit /etc/dnf/dnf.conf:

sudo vi /etc/dnf/dnf.conf

Add or modify:

fastestmirror=0

Alternatively, disable it temporarily for a single command:

sudo dnf --setopt=fastestmirror=0 update

Specifying a preferred mirror

If the issue is simply that fastestmirror picks a slow mirror, you can instead specify your preferred mirror directly. Edit your repo configuration:

sudo vi /etc/yum/repos.d/CentOS-Linux-BaseOS.repo

Replace the mirrorlist line with a direct baseurl:

# Comment out mirrorlist
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=baseos&infra=$infra

# Specify a direct mirror
baseurl=http://mirror.example.com/centos/$releasever/BaseOS/$basearch/os/

Use a geographically close or known-fast mirror from the CentOS mirror list.

Troubleshooting slow mirror detection

If fastestmirror itself is running slowly, check the age of the cached host file:

ls -la /var/cache/yum/timedhosts.txt

Remove stale cache to force re-detection:

sudo rm -f /var/cache/yum/timedhosts.txt
sudo yum clean all

For DNF:

sudo dnf clean all
sudo dnf makecache

Verify the plugin is disabled

Test that yum/dnf no longer uses mirror detection:

sudo yum check-update

or

sudo dnf check-update

You shouldn’t see messages about pinging or selecting mirrors. Run with verbose output to confirm:

sudo yum -v check-update 2>&1 | grep -i mirror

No output indicates the plugin is successfully disabled.

Similar Posts

  • | |

    Installing ns-2 and ns-3 on Fedora Linux

    Installing ns-2 and ns-3 on Fedora Linux ns (Network Simulator) is a discrete-event simulator used primarily for research and educational purposes in networking. The two major versions—ns-2 and ns-3—are substantially different in architecture and usage patterns. This guide covers installation on current Fedora systems. Installing ns-2 on Fedora Note: ns-2 is legacy software and requires…

  • Micosoft招聘部分算法题

    Micosoft招聘部分算法题 1.链表和数组的区别在哪里? 2.编写实现链表排序的一种算法。说明为什么你会选择用这样的方法? 3.编写实现数组排序的一种算法。说明为什么你会选择用这样的方法? 4.请编写能直接实现strstr()函数功能的代码。 5.编写反转字符串的程序,要求优化速度、优化空间。 6.在链表里如何发现循环链接? 7.给出洗牌的一个算法,并将洗好的牌存储在一个整形数组里。 8.写一个函数,检查字符是否是整数,如果是,返回其整数值。(或者:怎样只用4行代码编写出一个从字符串到长整形的函数?) 9.给出一个函数来输出一个字符串的所有排列。 10.请编写实现malloc()内存分配函数功能一样的代码。 11.给出一个函数来复制两个字符串A和B。字符串A的后几个字节和字符串B的前几个字节重叠。 12.怎样编写一个程序,把一个有序整数数组放到二叉树中? 13.怎样从顶部开始逐层打印二叉树结点数据?请编程。 14.怎样把一个链表掉个顺序(也就是反序,注意链表的边界条件并考虑空链表)? 来源:·日月光华 bbs.fudan.edu.cn Read more: Java Calling Native Functions in .DLL on Windows GNU glibc Manual C++ Reference and Styles Git through SSH Tunnel as Proxy Profiling Vim to Find Out Which Plugin Makes Vim Slow How to get a path’s…

  • Add readline features in OCaml toplevel

    Using the OCaml Toplevel with Readline Support The default OCaml toplevel lacks basic readline features like history, line editing, and command completion. Here are the practical approaches to fix this. utop: Full-Featured Replacement The best option for daily interactive OCaml work is utop, a replacement toplevel that provides: Syntax highlighting with color output Command completion…

  • How to decode a quoted URL in Python?

    URL Decoding with urllib.parse URL encoding (percent-encoding) converts special characters into a format safe for transmission over HTTP. In Python, the urllib.parse module provides straightforward functions for decoding these strings. Basic Decoding with unquote The unquote() function is the standard approach: from urllib.parse import unquote encoded_url = “https://example.com/search?q=hello%20world” decoded_url = unquote(encoded_url) print(decoded_url) # Output: https://example.com/search?q=hello…