原因是CentOS 6已經(jīng)隨著2020年11月的結(jié)束進(jìn)入了EOL(Reaches End of Life),,官方便在12月2日正式將CentOS 6相關(guān)的軟件源移出了官方源,,隨之而來逐級鏡像也會陸續(xù)將其刪除。
不過有一些老設(shè)備依然需要維持在當(dāng)前系統(tǒng),,CentOS官方也給這些還不想把CentOS 6扔進(jìn)垃圾堆的用戶保留了各個版本軟件源的鏡像,只是這個軟件源不會再有更新了,。 CentOS官方Vault源:http://vault./
首先把fastestmirror關(guān)了,,這個插件默認(rèn)會尋找離你最近的鏡像站去訪問: vi /etc/yum/pluginconf.d/fastestmirror.conf 修改這個參數(shù)enable=0 備份CentOS6系統(tǒng)源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 將下面的內(nèi)容復(fù)制進(jìn)去 vi /etc/yum.repos.d/CentOS-Base.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.9 - Base - vault. failovermethod=priority baseurl=http://vault./6.9/os/$basearch/ gpgcheck=1 gpgkey=http://vault./RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-6.9 - Updates - vault. failovermethod=priority baseurl=http://vault./6.9/updates/$basearch/ gpgcheck=1 gpgkey=http://vault./RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-6.9 - Extras - vault. failovermethod=priority baseurl=http://vault./6.9/extras/$basearch/ gpgcheck=1 gpgkey=http://vault./RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-6.9 - Plus - vault. failovermethod=priority baseurl=http://vault./6.9/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://vault./RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-6.9 - Contrib - vault. failovermethod=priority baseurl=http://vault./6.9/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://vault./RPM-GPG-KEY-CentOS-6 更換源后嘗試yum update,能夠正常獲取軟件列表即可,。 原文鏈接:http:///post/983.html |
|