關(guān)鍵詞:CentOS6 官方停止維護(hù)更新 源倉(cāng)庫(kù)失效 yum源失效 yum安裝報(bào)錯(cuò) yum更新報(bào)錯(cuò) [Errno 256] [Errno 14] [404 Not Found] 阿里鏡像源報(bào)錯(cuò)失效 網(wǎng)易鏡像源報(bào)錯(cuò)失效 epel CentOS5 背景:在進(jìn)行服務(wù)器系統(tǒng)安全類問(wèn)題更新時(shí),yum update 更新發(fā)現(xiàn)報(bào)錯(cuò)如下 [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror. To address this issue please refer to the below wiki article https://wiki./yum-errors If above article doesn't help to resolve this issue please use https://bugs./. 重新設(shè)置 yum 源后,用官方、阿里、網(wǎng)易等的源都是仍然報(bào)這個(gè)錯(cuò)。 換個(gè)思路,可能是源發(fā)生變更了,在查詢CentOS官網(wǎng)產(chǎn)品信息(https://wiki./zh/About/Product)后發(fā)現(xiàn)果然,CentOS6源倉(cāng)庫(kù)于2020.11.30停止維護(hù)更新了(CentOS5早在2017年初就停了),被移除了,因國(guó)內(nèi)各大鏡像源是同步的所以也都失效了。下面官方信息截圖于2020.12.29。 解決建議: 1、最安全:升級(jí)CentOS系統(tǒng)版本改用CentOS7或8或更高版本. 2、若生產(chǎn)環(huán)境對(duì)安全問(wèn)題(如漏洞更新補(bǔ)丁等)要求不是很嚴(yán)格,可用官網(wǎng)的舊版存檔 https://vault./ 先頂一段時(shí)間,該舊版存檔源由開(kāi)發(fā)者維護(hù)而不是官方了,所以一些安全更新等 偶爾 可能 會(huì)不是很及時(shí),且在國(guó)外下載獲取速度相對(duì)慢一點(diǎn)點(diǎn)。下面給出該方法具體: 1)查看當(dāng)前系統(tǒng)版本后面會(huì)用 cat /etc/issue [root]# cat /etc/issue CentOS release 6.10 (Final) Kernel \r on an \m [root]# 2)修改源倉(cāng)庫(kù)文件(先備份再操作!) cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup // 備份文件 將內(nèi)容中原來(lái)阿里或網(wǎng)易等鏡像的 url 鏈接改為 https://vault./ ,若用的是原來(lái) mirrorlist 源,就把 mirrorlist 開(kāi)頭的行注釋掉在旁邊新添加 baseurl 開(kāi)頭的行,案例如下 [base] name=CentOS-$releasever - Base baseurl=http://vault./$releasever/os/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://vault./$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://vault./$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=http://vault./$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib baseurl=http://vault./$releasever/contrib/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 注:若是CentOS5,還要將其中幾行 gpgkey=......KEY-CentOS-6 行末的 6 都改為 5 。 這時(shí),若版本號(hào)就是6,不是6.2或6.10等有小數(shù)點(diǎn)后綴的版本號(hào),保存后運(yùn)行 yum clean 然后 yum makecache 一般沒(méi)問(wèn)題,否則仍可能報(bào)錯(cuò),下面繼續(xù)。 3)若上步后仍然報(bào)錯(cuò),就是URL中的變量 \$releasever 值問(wèn)題,報(bào)錯(cuò)提示網(wǎng)址404,網(wǎng)址路徑不對(duì)應(yīng)。\$releasever 得到的值是發(fā)行版本號(hào)的整數(shù),無(wú)小數(shù)點(diǎn),查看命令 rpm -qi centos-release 顯示列表中 Version 值便是。若 系統(tǒng)實(shí)際 版本號(hào)是有小數(shù)點(diǎn)后綴的,可直接把 CentOS-Base.repo 文件內(nèi)容中幾行 baseurl 開(kāi)頭行中的 $releasever 替換為有小數(shù)點(diǎn)的版本號(hào),我的版本號(hào)是6.10,替換結(jié)果如下(記得先備份文件或注釋原有行復(fù)制粘貼新行再修改!): [base] name=CentOS-$releasever - Base baseurl=http://vault./6.10/os/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://vault./6.10/updates/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://vault./6.10/extras/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=http://vault./6.10/centosplus/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib baseurl=http://vault./6.10/contrib/$basearch/ #mirrorlist=http://mirrorlist./?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://mirror./centos/RPM-GPG-KEY-CentOS-6 保存運(yùn)行 yum clean 然后 yum makecache 再 yum update。 4)若仍然報(bào)錯(cuò),多半是因?yàn)樵O(shè)置了 epel 項(xiàng)目,報(bào)錯(cuò)中提示epel中的網(wǎng)址404,文件路徑 /etc/yum.repos.d/epel.repo,epel項(xiàng)目維護(hù)跟隨官方,所以也停止了維護(hù)被移除了。 啥是epel? 如果既想獲得 RHEL 的高質(zhì)量、高性能、高可靠性,又需要方便易用(關(guān)鍵是免費(fèi))的軟件包更新功能,那么 Fedora Project 推出的 EPEL(Extra Packages for Enterprise Linux)正好適合。EPEL(http:///wiki/EPEL) 是由 Fedora 社區(qū)打造,為 RHEL 及衍生發(fā)行版如 CentOS、Scientific Linux 等提供高質(zhì)量軟件包的項(xiàng)目。 這里將 epel.repo 文件重新命名為 epel.repo.back 讓epel找不到文件不去找額外包即可,也可直接刪除該文件但不推薦。 mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup 然后運(yùn)行 yum clean 然后 yum makecache 再 yum update。至此,結(jié)束。 小伙伴們?nèi)缬懈媒鉀Q方式或發(fā)現(xiàn)錯(cuò)誤,歡迎來(lái)評(píng)論補(bǔ)充或糾正~~~謝謝 (^ - ^ ) 技術(shù)顧問(wèn):我的朋友大佬牙哥~ 參考文章: 1、https://blog.csdn.net/CyanSkye/article/details/70045761 作者:CyanSkye 2、https://blog.51cto.com/xiaocao13140/2105528 這是轉(zhuǎn)載最早的文章,原作者找不到了 |
|