redhat使用163的yum源
阿新 • • 發佈:2019-01-28
注:redhat系統設定163yum源過程,今天搗鼓了下,網上很多文章上記錄的東西已經404了,記錄下,方便自己也方便大家
因為需要解除安裝系統自帶的yum,此處先把後面裝yum的一些包下載下來
wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm wget http://mirrors.163.com/centos/6.7/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
刪除系統自帶的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
安裝剛才下載的幾個包,需要注意的是yum-3.2.29-69與yum-plugin-fastestmirror這兩個需要一起安裝
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
更改預設的yum源配置,移走之前的,下載163對應的源
cd /etc/yum.repos.d/
mv rhel-source.repo rhel-source.repo.bak
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS6-Base-163.repo rhel-source.repo
替換url中的$releasever為實際版本,由於我之前裝的yum包就是6.7的,所以此處改為6.7
sed -i "s/\$releasever/6.8/g" rhel-source.repo
此時配置已完成,可以yum makecache了