Repository cache synchronization problem after the failure of the replacement yum source CentOS8

Cause of the problem: In the beginning CentOS 8 default yumsource is capable of normal use, but use the following command to install the Development Toolsfollowing:

yum groupinstall -y "Development Tools"

I do not know why it began to have problems synchronizing repository cache failure can not install some kits normal. The following error message:

[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    
同步仓库 'AppStream' 缓存失败,忽略这个 repo。
同步仓库 'BaseOS' 缓存失败,忽略这个 repo。
同步仓库 'extras' 缓存失败,忽略这个 repo。
元数据缓存已建立。
[root@localhost /etc/yum.repos.d]#

Then according to the error message to the Internet to find relevant solutions, most of them are said to replace Ali's yumsource, and then follow the instructions to replace the official documents were:

Originally I thought has been successfully resolved, can not think of a pit, to re-establish metadata cache when the cache is still prompted to synchronize warehouse failed:

[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.9                                         2.0 kB/s | 121 kB     01:01    
同步仓库 'AppStream' 缓存失败,忽略这个 repo。
同步仓库 'base' 缓存失败,忽略这个 repo。
同步仓库 'extras' 缓存失败,忽略这个 repo。
上次元数据过期检查:0:00:01 前,执行于 2020年03月23日 星期一 10时26分48秒。
元数据缓存已建立。
[root@mesos-master /etc/yum.repos.d]#

Then baffled, I wondered system default yumsource because of possible network Rom no problem, domestic sources should not be ah, is not provided with a problem? The results really is baseurlthe $releaseverand $basearchplaceholders somehow invalid. It will be $releaseverchanged 8, will $basearchbe changed x86_64after the problem is solved. The contents of each configuration file modified 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 done to solve the problem, no longer be prompted to sync repository cache failed:

[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.9                                          10 kB/s | 121 kB     00:11    
元数据缓存已建立。
[root@localhost /etc/yum.repos.d]# 

Guess you like

Origin blog.51cto.com/zero01/2481030