1、卸载rhel的默认安装的yum包
查看yum包
[bash autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”2″ toolbar=”true” language=”title=”]
rpm -qa|grep yum
[/bash]
卸载之
[bash autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”true” language=”title=”]
rpm -qa|grep yum|xargs rpm -e –nodeps
[/bash]
2、下载新的yum包
64位linux系统下载安装包
[bash autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”true” language=”title=”]
wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
[/bash]
32位linux系统下载安装包
[bash autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”true” 1=”language="title="example-filename.php"” language=”true”]
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
[/bash]
注意:安装包可能会升级,最后的文件名可以通过最新路径下查看得到,例如:
http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/
http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/
然后进行安装
[bash autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”true” language=”title=”]
rpm -ivh yum-*
[/bash]
注意:yum和yum-fastestmirror相互依赖,所以同时安装即可。
3、下载yum的配置源
[bash autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”true” language=”title=”]
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
[/bash]
下载到 /etc/yum.repos.d/ 目录下面
4、运行yum makecache生成缓存