CentOS8 uses Alibaba Cloud yum source exception

CentOS 8 solves the problem that yum cannot update the source
CentOS8 cannot use the Aliyun YUM source normally
[2022] Solve the problem that the Centos8 yum official source cannot be used after it goes offline (yum replaces the latest Ali source)
The following error occurs when Linux installs git

[root@raoyuuuu maven]# dnf install git
Repository extras is listed more than once in the configuration
Repository epel is listed more than once in the configuration
CentOS-8 - Base - mirrors.aliyun.com                                                                                                                                                                                                         
Errors during downloading metadata for repository 'base':
  - Curl error (28): Timeout was reached for http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml [Connection timed out after 30000 milliseconds]
  - Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 106.15.218.235)
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'base': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Using the yum makecache command is also the same problem. After searching for a solution, I didn’t find any useful ones. Finally, I found the above three articles.

reason:

Since centos8 will stop serving in 2022, the successor version will be 8-steam. An error is reported when using Aliyun's centos8 yum.

According to the above, just replace the version number. You
can test the address in the error message
https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml
insert image description here
and replace 8 with 8- The stream
insert image description here
description is indeed a version problem, because the first two tests are too cumbersome, directly follow the third method

solution

1. Enter the configuration file and delete all .repo files (you can also back them up)

#进入配置文件夹
cd /etc/yum.repos.d/
#删除旧的配置文件
rm *.repo
#输入“y”回车确认

ls Make sure that the .repo file in this directory has been completely deleted
Download the available .repo file

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

If you don't have wget installed, you can also use the following command:

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

Run yum makecache to generate cache
yum makecache

Complete
insert image description here
the installation of git is also successful
insert image description here

Guess you like

Origin blog.csdn.net/RoyRaoHR/article/details/123005317