Detailed explanation of the problem of failure to synchronize warehouse cache after changing yum source in CentOS8

Detailed explanation of the problem of failure to synchronize warehouse cache after changing yum source in CentOS8

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 the problem of synchronizing the warehouse cache failed to occur, and some tool packages 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  
Failed to sync cache for repository 'AppStream', ignoring this repo.
Failed to sync cache of repository 'BaseOS', ignoring this repo.
Failed to sync cache of repository 'extras', ignoring this repo.
The metadata cache is established.
[root@localhost /etc/yum.repos.d]#

So I searched for relevant solutions online according to the error message. Most of them said to change Alibaba's yum source, so I changed it according to the instructions in the official document:

https://developer.aliyun.com/mirror/centos

I thought I had solved the problem successfully, but there was still a pitfall. When I re-established the metadata cache, it still prompted that the synchronization warehouse cache 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  
Failed to sync cache for repository 'AppStream', ignoring this repo.
Failed to sync repository 'base' cache, ignoring this repo.
Failed to sync cache of repository 'extras', ignoring this repo.
Last metadata expiration check: 0:00:01 ago, performed on Monday, March 23, 2020 at 10:26:48.
The metadata cache is established.
[root@mesos-master /etc/yum.repos.d]#

Then I was puzzled. I thought that the system's default yum source might not be able to connect due to network problems, but the domestic source shouldn't be able to connect. Is there a problem with the configuration? It turns out that the $releasever and $basearch placeholders in baseurl are invalid for some reason. Therefore, the problem was solved by changing $releasever to 8 and $basearch 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 making the above changes, the problem is solved and there is no prompt that the synchronization warehouse 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  
The metadata cache is established.
[root@localhost /etc/yum.repos.d]#

This is the end of this article about the problem of failure to synchronize warehouse cache after changing yum source in CentOS8. For more related content about failure to synchronize warehouse after changing yum source in CentOS8, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Steps to install php mysql gd using yum on centos6
  • Detailed explanation of CentOS installation of MariaDB using YUM
  • How to configure domestic sources in CentOS8 yum/dnf
  • How to install PHP7.2 with CentOS7yum
  • CentOS yum installs mongodb and php extensions
  • Detailed explanation of how to configure local yum source in centos7
  • Tutorial on how to build and install linux+apache+mysql+php environment with yum under centos
  • Tutorial on installing lnmp using yum on centos7 (linux+nginx+php7.1+mysql5.7)

<<:  Solution to the problem of eight hours difference in MySQL insertion time

>>:  Detailed explanation of the failure of MySQL to use UNION to connect two queries

Recommend

Detailed explanation of Mysql communication protocol

1.Mysql connection method To understand the MySQL...

The hottest trends in web design UI in 2013 The most popular UI designs

Time flies, and in just six days, 2013 will becom...

Detailed explanation of how Tomcat implements asynchronous Servlet

Preface Through my previous Tomcat series of arti...

Detailed explanation of JSONObject usage

JSONObject is just a data structure, which can be...

Tutorial on how to remotely connect to MySQL database under Linux system

Preface I recently encountered this requirement a...

Analyze the difference between ES5 and ES6 apply

Table of contents Overview Function signature Opt...

CSS pseudo-class: empty makes me shine (example code)

Anyone who has read my articles recently knows th...

mysql5.5 installation graphic tutorial under win7

MySQL installation is relatively simple, usually ...

A brief discussion on Mysql specified order sorting query

Recently, I have been working on a large-screen d...

Comprehensive analysis of MySql master-slave replication mechanism

Table of contents Master-slave replication mechan...

Randomly generate an eight-digit discount code and save it to the MySQL database

Currently, many businesses are conducting promoti...

Detailed explanation of JavaScript upload file limit parameter case

Project scenario: 1. Upload file restrictions Fun...

Explore VMware ESXI CLI common commands

Table of contents 【Common commands】 [Summary of c...

Detailed explanation of how to install PHP7 on Linux

How to install PHP7 on Linux? 1. Install dependen...