阿里云centos6系統(tǒng)yum源錯(cuò)誤解決方法

阿里云ESC云主機(jī)centos6系統(tǒng)yum更新時(shí),會(huì)遇到類似如下404等錯(cuò)誤:

http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host" Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

處理方法:修改/etc/yum.repos.d/目錄下的CentOS-Base.repo半夷、epel.repo文件

把CentOS-Base.repo文件中的以下網(wǎng)址
http://mirrors.aliyun.com/centos/
http://mirrors.aliyuncs.com/centos/
http://mirrors.cloud.aliyuncs.com/centos/
修改成
http://mirrors.aliyun.com/centos-vault/centos/
 
把epel.repo文件中的
enabled=1
修改成
enabled=0

修改后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-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/os/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/os/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/updates/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/updates/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/extras/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/extras/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/centosplus/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/centosplus/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/contrib/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/contrib/$basearch/
        http://mirrors.aliyun.com/centos-vault/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6

修改后epel.repo文件

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.aliyun.com/epel/6/$basearch
failovermethod=priority
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/6/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
 
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/6/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0

安裝阿里云yum源

1胳挎、備份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2饼疙、下載新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后運(yùn)行yum makecache生成緩存
yum clean all
yum makecache

參考文檔

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末慕爬,一起剝皮案震驚了整個(gè)濱河市窑眯,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌医窿,老刑警劉巖磅甩,帶你破解...
    沈念sama閱讀 212,222評(píng)論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異留搔,居然都是意外死亡更胖,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,455評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門隔显,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)却妨,“玉大人,你說我怎么就攤上這事括眠”氡辏” “怎么了?”我有些...
    開封第一講書人閱讀 157,720評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵掷豺,是天一觀的道長(zhǎng)捞烟。 經(jīng)常有香客問我,道長(zhǎng)当船,這世上最難降的妖魔是什么题画? 我笑而不...
    開封第一講書人閱讀 56,568評(píng)論 1 284
  • 正文 為了忘掉前任,我火速辦了婚禮德频,結(jié)果婚禮上苍息,老公的妹妹穿的比我還像新娘。我一直安慰自己壹置,他們只是感情好竞思,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,696評(píng)論 6 386
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著钞护,像睡著了一般盖喷。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上难咕,一...
    開封第一講書人閱讀 49,879評(píng)論 1 290
  • 那天课梳,我揣著相機(jī)與錄音距辆,去河邊找鬼。 笑死惦界,一個(gè)胖子當(dāng)著我的面吹牛挑格,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播沾歪,決...
    沈念sama閱讀 39,028評(píng)論 3 409
  • 文/蒼蘭香墨 我猛地睜開眼漂彤,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了灾搏?” 一聲冷哼從身側(cè)響起挫望,我...
    開封第一講書人閱讀 37,773評(píng)論 0 268
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎狂窑,沒想到半個(gè)月后媳板,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,220評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡泉哈,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,550評(píng)論 2 327
  • 正文 我和宋清朗相戀三年蛉幸,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片丛晦。...
    茶點(diǎn)故事閱讀 38,697評(píng)論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡奕纫,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出烫沙,到底是詐尸還是另有隱情匹层,我是刑警寧澤,帶...
    沈念sama閱讀 34,360評(píng)論 4 332
  • 正文 年R本政府宣布锌蓄,位于F島的核電站升筏,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏瘸爽。R本人自食惡果不足惜您访,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,002評(píng)論 3 315
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望剪决。 院中可真熱鬧灵汪,春花似錦、人聲如沸昼捍。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,782評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)妒茬。三九已至,卻和暖如春蔚晨,著一層夾襖步出監(jiān)牢的瞬間乍钻,已是汗流浹背肛循。 一陣腳步聲響...
    開封第一講書人閱讀 32,010評(píng)論 1 266
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留银择,地道東北人多糠。 一個(gè)月前我還...
    沈念sama閱讀 46,433評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像浩考,于是被迫代替她去往敵國(guó)和親夹孔。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,587評(píng)論 2 350

推薦閱讀更多精彩內(nèi)容