CentOS6 無法更新問題

CentOS6 無法更新問題

問題:YumRepo Error:All mirror URLs are not using http or file

01 CentOS6 官方停止更新

諸如關停防火牆;重置DNS 8.8.8.8;切換成國內阿里雲,網易等yum源,修改 /etc/yum.repos.d/CentOS-Base.repo文件等方法,依舊沒法通過yum命令調用資源

CentoS 6 停止維護更新日期:2020年11月30日
CentOS 7 停止維護更新日期:2024年6月
CentOS 8 停止維護更新日期:2029年5月

02 可用的更新源

centos 6.10 dvd1
centos 6.10 dvd2
嘗試了很多方法,目前(20201229)這個是可用的。

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

https://www.xmpan.com/Centos-6-Vault-Aliyun.repo的具體內容如下:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

03 更新支持gcc的更新源

更新gcc的更新源,需要參考源scl源的內容及https://vault.centos.org對應版本官網目錄信息,把baseurl修改爲想要更新的版本
sudo vim /etc/yum.repos.d/CentOS-SCLo-rh.repo

#baseurl=http://mirror.centos.org/centos/$releasever/sclo/$basearch/rh/
baseurl=https://vault.centos.org/6.9/sclo/x86_64/rh/
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章