绕过subscriptionmanager搭建yum工具

环境:Redhat 5.7


1. 删除redhat原有的yum

 rpm-aq|grep yum|xargs rpm -e –nodeps


2. 下载yum安装文件
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm


3. 安装yum
rpm -ivh python-iniparse-0.2.3-6.el5.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
若安装中出现python(abi) = 2.6 is needed by python-iniparse-0.3.1-2.1.el6.noarch,请参考:http://www.cnblogs.com/end/archive/2012/10/24/2736841.html


4. 从mirrors.163.com下载centos对应的repo文件:http://mirrors.163.com/.help/CentOS5-Base-163.repo
mv  CentOS5-Base-163.repo /etc/yum.repos.d/


5. 修改CentOS5-Base-163.repo
vi CentOS5-Base-163.repo
:%s/$releasever/5/g


6. yum clean all && yum makecache


7. yum update -y

 

你可能感兴趣的:(Linux,Technology)