After CentOS8 replaces yum source, there is a problem of synchronization warehouse cache failure

The cause of the problem: At first, the default yum source of CentOS 8 can be used normally, but after installing Development Tools using the following command:

yum groupinstall -y "Development Tools"

I don’t know why I started to have the problem of synchronization warehouse cache failure, and some toolkits could not be installed normally. The error message is as follows:

[ root@localhost /etc/yum.repos.d]# yum makecache
CentOS-8.0- AppStream                                    19  B/s |38  B     00:02    
CentOS-8.0- Base                                         24  B/s |38  B     00:01    
CentOS-8.0- Extras                                       8.4  B/s |38  B     00:04    
Sync warehouse'AppStream'Cache failed, ignore this repo.
Sync warehouse'BaseOS'Cache failed, ignore this repo.
Sync warehouse'extras'Cache failed, ignore this repo.
The metadata cache has been established.
[ root@localhost /etc/yum.repos.d]#

So according to the error message, I went to the Internet to find related solutions. Most of them said to replace Ali's yum source, and then replaced it according to the official document:

I thought it was resolved smoothly, but I didn't think there were any pits. When the metadata cache was re-established, it still prompted the synchronization warehouse cache failure:

[ root@mesos-master /etc/yum.repos.d]# yum makecache
CentOS-8.0- AppStream - mirrors.aliyun.com                   0.0  B/s |0  B     00:24    
CentOS-8.0- Base - mirrors.aliyun.com                        0.0  B/s |0  B     00:32    
CentOS-8.0- Extras - mirrors.aliyun.com                      0.0  B/s |0  B     00:32    
CentOS-8.0- Epel                                             2.3 MB/s |6.0 MB     00:02    
WANdisco SVN Repo 1.92.0 kB/s |121 kB     01:01    
Sync warehouse'AppStream'Cache failed, ignore this repo.
Sync warehouse'base'Cache failed, ignore this repo.
Sync warehouse'extras'Cache failed, ignore this repo.
Last metadata expiration check: 0:00:Before 01, it will be executed at 10:26:48 on Monday, March 23, 2020.
The metadata cache has been established.
[ root@mesos-master /etc/yum.repos.d]#

Then I was puzzled. I thought that the default yum source of the system might not be connected because of the network. It shouldn't be a domestic source. Is there a configuration problem? The result is that the releasever and basearch placeholders in baseurl are invalid for some reason. Therefore, the problem was solved after the releasever was changed to 8, and the basearch was changed to x86_64. The contents of the modified configuration files are as follows:

### cat CentOS-Base.repo ###
[ base]
name=CentOS-8- Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/
  http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/
  http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

### cat CentOS-AppStream.repo ###
[ AppStream]
name=CentOS-8- AppStream - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/AppStream/x86_64/os/
  http://mirrors.aliyuncs.com/centos/8/AppStream/x86_64/os/
  http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

### cat CentOS-Extras.repo ###
[ extras]
name=CentOS-8- Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/extras/x86_64/os/
  http://mirrors.aliyuncs.com/centos/8/extras/x86_64/os/
  http://mirrors.cloud.aliyuncs.com/centos/8/extras/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

### cat CentOS-Epel.repo ###
[ epel]
name=CentOS-$releasever - Epel
baseurl=http://mirrors.aliyun.com/epel/8/Everything/$basearch
enabled=1
gpgcheck=0

### cat CentOS-PowerTools.repo ###
[ PowerTools]
name=CentOS-8- PowerTools - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/PowerTools/x86_64/os/
  http://mirrors.aliyuncs.com/centos/8/PowerTools/x86_64/os/
  http://mirrors.cloud.aliyuncs.com/centos/8/PowerTools/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

### cat CentOS-centosplus.repo ###
[ centosplus]
name=CentOS-8- Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/centosplus/x86_64/os/
  http://mirrors.aliyuncs.com/centos/8/centosplus/x86_64/os/
  http://mirrors.cloud.aliyuncs.com/centos/8/centosplus/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

After the above modifications are made, the problem is solved, and there is no more prompt to synchronize the warehouse cache:

[ root@localhost /etc/yum.repos.d]# yum makecache
CentOS-8- AppStream - mirrors.aliyun.com                      2.1 MB/s |6.5 MB     00:03    
CentOS-8- Base - mirrors.aliyun.com                           1.6 MB/s |5.0 MB     00:03    
CentOS-8- Extras - mirrors.aliyun.com                         1.8 kB/s |4.2 kB     00:02    
CentOS-8.0- Epel                                              2.2 MB/s |6.0 MB     00:02    
WANdisco SVN Repo 1.910 kB/s |121 kB     00:11    
The metadata cache has been established.
[ root@localhost /etc/yum.repos.d]# 

Recommended Posts

After CentOS8 replaces yum source, there is a problem of synchronization warehouse cache failure
Centos 8.1.1911 solves the problem of yum reinstallation