如何解決yum無(wú)法安裝epel-release的問(wèn)題
yum無(wú)法安裝epel-release
在學(xué)習(xí)Hadoop的過(guò)程中準(zhǔn)備環(huán)境時(shí)需要安裝epel-release
在安裝之前ping了一下www.baidu.com 發(fā)現(xiàn)能ping通,然后就去安裝了,然后就發(fā)現(xiàn)問(wèn)題了
去網(wǎng)上搜了一下然后感覺(jué)應(yīng)該是鏡像源的問(wèn)題,
嘗試了第一種方法
修改了/etc/yum.repos.d目錄下的CentOS-Base.rep文件,將文件中的原有內(nèi)容改為
# 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 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ #baseurl=http://vault.centos.org/7.9.2009/x86_64/os/ baseurl=http://vault.centos.org/7.9.2009/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ #baseurl=http://vault.centos.org/7.9.2009/x86_64/os/ baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra #$baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ #baseurl=http://vault.centos.org/7.9.2009/x86_64/os/ baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ #baseurl=http://vault.centos.org/7.9.2009/x86_64/os/ baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
然后執(zhí)行
sudo yum clean all sudo yum makecache
然后我的這兩個(gè)命令就都加載失敗了,我覺(jué)得就是這個(gè)不行
但是我把后續(xù)的解決方法放到下面,有人成功了可以繼續(xù)往下試試
再執(zhí)行
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
然后查看一下CentOS-Base.repo`中的地址是否改成阿里云的了
cat CentOS-Base.repo`
再此嘗試導(dǎo)入wget命令 好的成功了
第二種方法(我就是用這種方法解決的)
#建議是備份一下 rm -rf /etc/yum.repos.d mkdir /etc/yum.repos.d wget http://mirrors.aliyun.com/repo/Centos-7.repo cp Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo #安裝 rpm -ivh wget-1.14-15.el7_4.1.x86_64.rpm yum clean all yum makecache
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Linux printf如何將十進(jìn)制轉(zhuǎn)換為十六進(jìn)制
文章總結(jié):介紹了十進(jìn)制、十六進(jìn)制和八進(jìn)制之間的轉(zhuǎn)換方法,包括使用\b命令和bc工具進(jìn)行轉(zhuǎn)換的技巧2024-12-12linux下建站目錄分配權(quán)限的經(jīng)驗(yàn)技巧總結(jié)
在建站的時(shí)候給目錄分配權(quán)限是非常重要的,也是建站的程序員們必須要會(huì)的,下面這篇文章主要給大家總結(jié)了在linux下建站目錄分配權(quán)限的經(jīng)驗(yàn)技巧,需要的朋友可以參考借鑒,下面來(lái)一起看看吧。2017-06-06使用apachetop實(shí)時(shí)監(jiān)控日志、動(dòng)態(tài)分析服務(wù)器運(yùn)行狀態(tài)
這篇文章主要介紹了使用apachetop實(shí)時(shí)監(jiān)控日志、動(dòng)態(tài)分析服務(wù)器運(yùn)行狀態(tài),通過(guò)apachetop這個(gè)工具可以動(dòng)態(tài)的查看apache的日志文件,還可以直觀的看到訪(fǎng)問(wèn)的每個(gè)地址的請(qǐng)求數(shù)、速度及流量等信息,需要的朋友可以參考下2014-06-06linux Apache服務(wù)器系統(tǒng)安全設(shè)置與優(yōu)化
結(jié)合,mod_gzip 和緩沖工具等,我們完全可以使一臺(tái)配置較低的 PC 有足夠的能力處理各種 HTML/CGI 等的請(qǐng)求。2008-07-07