系统:

 Red Hat Enterprise Linux Server release 5 (Tikanga)  

如果不确定系统版本,可以用下面的命令查看系统版本:

~]#cat /etc/issue  

Red Hat Enterprise Linux Server release 5 (Tikanga) 

Kernel \r on an \m 

 

1.卸载rhel的默认安装的yum包

查看yum包 

~]# rpm -qa|grep yum 

卸载之  

~]# rpm -qa|grep yum|xargs rpm -e --nodeps 

 

2.

检查依赖包下载并安装

 ~]#rpm -qa|grep python  

在出来的结果中查看是否有python和python-iniparse两个包

一般都有python而没有

python-iniparse,需要下载安装:

~]#wget 

安装:

~]#rpm -ivh  python-* 

 

2.

下载新的yum包

~]#wget 

ntos.noarch.rpm  

~]#wget .

1.16-16.el5.centos.noarch.rpm  

~]#wget 

r-1.1.2-3.el5.centos.i386.rpm 

安装

~]#rpm -ivh yum-*   

如果安装失败,可以在安装命令后加上

--nodeps --force

参数,意思是不检查包之间的依赖关系。

3.

下载yum的配置源

下载到/etc/yum.repos.d/ 目录下面

~]#cd /etc/yum.repos.d/  

yum.repos.d]#wget 

4.导入KEY

~]#rpm -import 

 

5.运行yum makecache生成缓存

~]#yum makecache  

Loaded plugins: fastestmirror 

Determining fastest mirrors  

 

现在就可以使用yum安装了。

centOS的yum包地址,下面的都可以用

配置源地址

 

————————————————————

vim /etc/yum.repos.d/rhel-debuginfo.repo:

 [rhel-debuginfo]

name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
#baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release