Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Centos yum exception problem

Shulou Source: shulou.com Published: 2022-06-03 03:51:49 10月04日 Update

When you encountered a problem with yum update while building the environment, the following error was reported:

YumRepo Error: All mirror URLs are not using ftp, http [s] or file.

Eg. $releasever is not a valid release or hasnt been released yet/

Removing mirrorlist with no valid mirrors: / var/cache/yum/base/mirrorlist.txt

Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

There are generally three reasons for analysis:

1. It is possible that the firewall blocked the outbound http request or ftp request, service iptables status

two。 It is possible that the dns is incorrect and cannot be parsed properly. Change it to 8.8.8.8.

3. The system cannot get the Release number

When testing the environment, you can use ping www.baidu.com to show that you can ping, which means that there is no problem with DNS, which may be the third reason.

You need to modify * .yum by replacing the $releasever variable with 6 in the repo source file.

Vim / etc/yum.repos.d/CentOS6-Base-163.repo

[

[base]

Name=CentOS-6-Base-163.com

Baseurl= http://mirrors.163.com/centos/6/os/$basearch/

# mirrorlist= http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

Gpgcheck=1

Gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# released updates

[updates]

Name=CentOS-6-Updates-163.com

Baseurl= http://mirrors.163.com/centos/6/updates/$basearch/

# mirrorlist= http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

Gpgcheck=1

Gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# additional packages that may be useful

[extras]

Name=CentOS-6-Extras-163.com

Baseurl= http://mirrors.163.com/centos/6/extras/$basearch/

# mirrorlist= http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

Gpgcheck=1

Gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# additional packages that extend functionality of existing packages

[centosplus]

Name=CentOS-6-Plus-163.com

Baseurl= http://mirrors.163.com/centos/6/centosplus/$basearch/

# mirrorlist= http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

Gpgcheck=1

Enabled=0

Gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# contrib-packages by Centos Users

[contrib]

Name=CentOS-6-Contrib-163.com

Baseurl= http://mirrors.163.com/centos/6/contrib/$basearch/

# mirrorlist= http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

Gpgcheck=1

Enabled=0

Gpgkey= http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

]

Last update cache: yum makecache

Tags: Problems causes environment updates no lieutenant general variables that is source files systems caches errors firewalls analysis testing fire prevention Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Shulou Information Apple Redmi