Unable to use Yum and Dnf on CentOS 8

1.Root cause: CentOS 8 - End of updates by late 2021.

 

 

2.Error screenshot:

 

3.Error keywords:

Failed to synchronize cache for repo 'AppStream', ignoring this repo.

Note: Unable to synchronize the cache for 'AppStream' repo, ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.

Note: Unable to synchronize the cache for 'BaseOS' repo, ignoring this repo.

Last metadata expiration check: 0:45:16 ago on Thu Jul 7 19:20:18 2022.

Note: Last metadata expiration check: 0:45:16 before Thursday, July 7, 2022, 19:20:18.
No match for argument: wget

Note: Parameter mismatch: wget.
Error: Unable to find a match

Note: Error: No match found.

 

4.Solution:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Execute the adjustments one by one, and then you should be able to use Dnf or Yum.

 

 Note: To fix the above error, we need to use the following command to change the repo URL pointing to the CentOS official URL to vault.centos.org 

 

If the above is not working, you can use the following command (Aliyun mirror):

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

 

yum makecache

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

CentOS 7.x Firewall: Enable/Disable and Add Ports

  In CentOS 7.x, the default firewall is firewalld. Here is an example using CentOS 7.6...

How to enable/disable ping on Linux system

To prevent others from discovering and potentially attacking your machine through network ping...

How to View Memory Usage and Clear Cache in Linux System

Sometimes, when a server becomes unresponsive, it may not necessarily be due to high CPU usage....

How to remotely access a Linux system using Putty tool

Introduction to Putty software PuTTY is a Telnet, SSH, rlogin, raw TCP, and serial interface...

Linux System RuiSu Installation Tutorial

Note: The prerequisite for installing RuiSu is to ensure that the network card is in the "eth"...