開發(fā)環(huán)境誤刪系統(tǒng)配置yum無法使用

報(bào)錯日志:

l/var/cache/yum/x86_64/$releasever/docker-ce-stable/repomd.xml

[root@node01 yum.repos.d]# rpm -import http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-7

[root@node01 yum.repos.d]# yum install vim

Loaded plugins: aliases, protectbase

http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

Trying other mirror.

To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

^Chttp://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"

Trying other mirror.

http://mirrors.cloud.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"

Trying other mirror.

docker-ce-stable? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 3.5 kB? 00:00:00

http://mirrors.aliyun.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

Trying other mirror.

^Chttp://mirrors.aliyuncs.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"

Trying other mirror.

http://mirrors.cloud.aliyuncs.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"

Trying other mirror.

One of the configured repositories failed (CentOS-$releasever - Extras - mirrors.aliyun.com),

and yum doesn't have enough cached data to continue. At this point the only

safe thing yum can do is fail. There are a few ways to work "fix" this:

? ? 1. Contact the upstream for the repository and get them to fix the problem.

? ? 2. Reconfigure the baseurl/etc. for the repository, to point to a working

? ? ? ? upstream. This is most often useful if you are using a newer

? ? ? ? distribution release than is supported by the repository (and the

? ? ? ? packages for the previous distribution release still work).

? ? 3. Run the command with the repository temporarily disabled

? ? ? ? ? ? yum --disablerepo=extras ...

? ? 4. Disable the repository permanently, so yum won't use it by default. Yum

? ? ? ? will then just ignore the repository until you permanently enable it

? ? ? ? again or use --enablerepo for temporary usage:

? ? ? ? ? ? yum-config-manager --disable extras

? ? ? ? or

? ? ? ? ? ? subscription-manager repos --disable=extras

? ? 5. Configure the failing repository to be skipped, if it is unavailable.

? ? ? ? Note that yum will try to contact the repo. when it runs most commands,

? ? ? ? so will have to try and fail each time (and thus. yum will be be much

? ? ? ? slower). If it is a very temporary problem though, this is often a nice

? ? ? ? compromise:

? ? ? ? ? ? yum-config-manager --save --setopt=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.

http://mirrors.aliyun.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

http://mirrors.aliyuncs.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"

http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"

問題描述:

我在安裝CDH時(shí)安裝失敗后葬毫,我刪除了CDH相關(guān)的配置,誤刪了一些系統(tǒng)配置文件闯捎,然后在使用yum安裝vim插件時(shí)報(bào)錯

解決方案:

于是我換成了aliyun的鏡像撒蟀,之后無論是執(zhí)行 yum clean all / yum update 都會有報(bào)錯

當(dāng)然我們?nèi)绻薪?jīng)驗(yàn)的開發(fā)者會一眼發(fā)現(xiàn)問題之所在:

http://mirrors.aliyuncs.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"

這個(gè)鏡像地址有個(gè)很重要的信息:$releasever?

這是一個(gè)系統(tǒng)版本的引用變量叙谨,結(jié)果是引用失敗的,

正確地址應(yīng)該是(我的操作系統(tǒng)是centos7):

http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml

我對?/etc/yum.repos.d/CentOS-Base.repo 這個(gè)文件進(jìn)行了更改

把所有的系統(tǒng)引用變量($releasever?)改為你的系統(tǒng)版本即可

問題就此解決

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末保屯,一起剝皮案震驚了整個(gè)濱河市手负,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌姑尺,老刑警劉巖竟终,帶你破解...
    沈念sama閱讀 219,110評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異切蟋,居然都是意外死亡统捶,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,443評論 3 395
  • 文/潘曉璐 我一進(jìn)店門柄粹,熙熙樓的掌柜王于貴愁眉苦臉地迎上來喘鸟,“玉大人,你說我怎么就攤上這事镰惦∶允兀” “怎么了犬绒?”我有些...
    開封第一講書人閱讀 165,474評論 0 356
  • 文/不壞的土叔 我叫張陵旺入,是天一觀的道長。 經(jīng)常有香客問我,道長茵瘾,這世上最難降的妖魔是什么礼华? 我笑而不...
    開封第一講書人閱讀 58,881評論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮拗秘,結(jié)果婚禮上圣絮,老公的妹妹穿的比我還像新娘。我一直安慰自己雕旨,他們只是感情好扮匠,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,902評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著凡涩,像睡著了一般棒搜。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上活箕,一...
    開封第一講書人閱讀 51,698評論 1 305
  • 那天力麸,我揣著相機(jī)與錄音,去河邊找鬼育韩。 笑死克蚂,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的筋讨。 我是一名探鬼主播埃叭,決...
    沈念sama閱讀 40,418評論 3 419
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼版仔!你這毒婦竟也來了游盲?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,332評論 0 276
  • 序言:老撾萬榮一對情侶失蹤蛮粮,失蹤者是張志新(化名)和其女友劉穎益缎,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體然想,經(jīng)...
    沈念sama閱讀 45,796評論 1 316
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡莺奔,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,968評論 3 337
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了变泄。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片令哟。...
    茶點(diǎn)故事閱讀 40,110評論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖妨蛹,靈堂內(nèi)的尸體忽然破棺而出屏富,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 35,792評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站棘街,受9級特大地震影響远舅,放射性物質(zhì)發(fā)生泄漏本今。R本人自食惡果不足惜卖局,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,455評論 3 331
  • 文/蒙蒙 一知给、第九天 我趴在偏房一處隱蔽的房頂上張望阔墩。 院中可真熱鬧已日,春花似錦垛耳、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,003評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至护奈,卻和暖如春泡嘴,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背逆济。 一陣腳步聲響...
    開封第一講書人閱讀 33,130評論 1 272
  • 我被黑心中介騙來泰國打工酌予, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人奖慌。 一個(gè)月前我還...
    沈念sama閱讀 48,348評論 3 373
  • 正文 我出身青樓抛虫,卻偏偏與公主長得像,于是被迫代替她去往敵國和親简僧。 傳聞我的和親對象是個(gè)殘疾皇子建椰,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,047評論 2 355