【常見問題】CentOS6 yum命令報錯YumRepo Error: All mirror URLs are not using ftp, http[s] or file


CentOS6已經在2020年11月30日停止維護了。centos官方停止了對centos6的所有更新,並且下架了包括官方所有的centos6源,目前阿里、163、清華等centos6源已無法使用。

1、更新yum源:

1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
2(Centos7為:wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo)

 

2、自動加載一下在線更新源:yum list    

 

 

3、如果上面執行yum list 仍報錯,則按照如下步驟操作:

一、備份配置文件,防止以后出錯后不好恢復
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

二、執行下面命令,新建CentOS-Base.repo配置:
vim /etc/yum.repos.d/CentOS-Base.repo

三、復制粘貼如下命令:
[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6

四、執行yum list

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM