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

Solution to "No input file specified" in nginx+php

Today, the error "No input file specified&qu...

Docker installation and deployment example on Linux

After reading the following article, you can depl...

Solve the problem of inconsistent MySQL storage time

After obtaining the system time using Java and st...

Specific use of the autoindex module in the Nginx Http module series

The main function of the brower module is to dete...

How to implement the paging function of MyBatis interceptor

How to implement the paging function of MyBatis i...

js simple and crude publish and subscribe sample code

What is Publish/Subscribe? Let me give you an exa...

React antd realizes dynamic increase and decrease of form

I encountered a pitfall when writing dynamic form...

Detailed explanation of Nginx configuration file

The main configuration file of Nginx is nginx.con...

How to use rem adaptation in Vue

1. Development environment vue 2. Computer system...

Detailed steps to store emoji expressions in MySQL

Caused by: java.sql.SQLException: Incorrect strin...

Several ways to center a box in Web development

1. Record several methods of centering the box: 1...

Calculation of percentage value when the css position property is absolute

When position is absolute, the percentage of its ...