Centos 6 cannot use yum solution_prompt Error: Cannot find a valid baseurl for repo: base

888u

Last update at :2024-01-26,Edit by888u

Recently, some netizens reported that the yum command of Centos 6 cannot be used, and the error message encountered is as follows:

[root@c8-20 ~]# yum -y install wget Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt Error: Cannot find a valid baseurl for repo: base

CentOS 6 has entered EOL (Reaches End of Life) with the end of November 2020. However, some old devices still need support. CentOS officials also reserve it for those users who do not want to throw CentOS 6 into the trash. The last version of the image has been installed, but this image will no longer be updated. To put it simply, the official has abandoned this image.

I chose two Vault sources to replace. One is the official http://vault.centos.org, which uses the North American AWS server. If you are overseas, you can use this; the other is Alibaba's http:/ /mirrors.aliyun.com/centos-vault/, mainland China will not be stuck when using this.

1. First turn off fastestmirrors

#edit vi /etc/yum/pluginconf.d/fastestmirror.conf #Revise enable=0

2. First move the previous repo to backup, and then choose one of the following two

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

3. Replace with the official Vault source

wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA% 90/SourcesList/Centos-6-Vault-Official.repo

Or users in mainland China can replace it with the Alibaba Cloud Vault image

wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA% 90/SourcesList/Centos-6-Vault-Aliyun.repo

4. If there is no wget, please use SFTP or edit /etc/yum.repos.d/CentOS-Base.repo directly with nano or vi! Replace the content inside with one of these two. Mainland China uses the second Ali, and foreign countries recommend the first official one.

5. It is recommended to use one-click repair for lazy people

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo yum clean all yum makecache

Recommended site searches: Hong Kong cloud host, domain name check, domain name price, Hong Kong server hosting, US website space, website server, com domain name registration, filing space, permanent free space, Hong Kong proxy server,

Centos 6 cannot use yum solution_prompt Error: Cannot find a valid baseurl for repo: base

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码