- 資訊首頁(yè) > 互聯(lián)網(wǎng) > 主機資訊 >
- Centos 6無(wú)法使用yum的解決方法_提示Error: Cannot fi
最近有網(wǎng)友反饋說(shuō)Centos 6的yum命令無(wú)法使用了,遇到的錯誤提示如下:
[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已經(jīng)隨著(zhù)2020年11月的結束進(jìn)入了EOL(Reaches End of Life),不過(guò)有一些老設備依然需要支持,CentOS官方也給這些還不想把CentOS 6扔進(jìn)垃圾堆的用戶(hù)保留了最后一個(gè)版本的鏡像,只是這個(gè)鏡像不會(huì )再有更新了。簡(jiǎn)單來(lái)說(shuō)就是官方已經(jīng)拋棄了這個(gè)鏡像。
更換的Vault源我選了兩個(gè),一個(gè)是官方的http://vault.centos.org,使用的北美AWS的服務(wù)器,海外的話(huà)使用這個(gè)就可以;還有一個(gè)是阿里的http://mirrors.aliyun.com/centos-vault/,國內使用這個(gè)不會(huì )卡。
1、首先把fastestmirrors關(guān)了
#編輯 vi /etc/yum/pluginconf.d/fastestmirror.conf #修改 enable=0
2、先把之前的repo挪到備份,然后下面兩個(gè)二選一
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
3、替換為官方Vault源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/其他資源/SourcesList/Centos-6-Vault-Official.repo
或者國內用戶(hù)可以替換為阿里云Vault鏡像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/其他資源/SourcesList/Centos-6-Vault-Aliyun.repo
4、如果沒(méi)有wget的話(huà),請使用SFTP或者直接nano、vi編輯/etc/yum.repos.d/CentOS-Base.repo!里面的東西替換成這兩個(gè)選一個(gè),國內用第二個(gè)阿里,國外建議第一個(gè)官方。
5、推薦使用懶人專(zhuān)用一鍵修復
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
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站