如何解決yum無法安裝epel-release的問題
yum無法安裝epel-release
在學習Hadoop的過程中準備環(huán)境時需要安裝epel-release
在安裝之前ping了一下www.baidu.com 發(fā)現(xiàn)能ping通,然后就去安裝了,然后就發(fā)現(xiàn)問題了
去網(wǎng)上搜了一下然后感覺應該是鏡像源的問題,
嘗試了第一種方法
修改了/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
然后我的這兩個命令就都加載失敗了,我覺得就是這個不行
但是我把后續(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`
再此嘗試導入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
總結
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
使用apachetop實時監(jiān)控日志、動態(tài)分析服務器運行狀態(tài)
這篇文章主要介紹了使用apachetop實時監(jiān)控日志、動態(tài)分析服務器運行狀態(tài),通過apachetop這個工具可以動態(tài)的查看apache的日志文件,還可以直觀的看到訪問的每個地址的請求數(shù)、速度及流量等信息,需要的朋友可以參考下2014-06-06linux Apache服務器系統(tǒng)安全設置與優(yōu)化
結合,mod_gzip 和緩沖工具等,我們完全可以使一臺配置較低的 PC 有足夠的能力處理各種 HTML/CGI 等的請求。2008-07-07