由于rhel操作系统没有直接的yum源,所以我们可以更换他的yum包,比如说使用centos的 yum包然后指定centos的yum源,就可以更新软件包了。采用如下步骤更新。最后 yum makecache 以后 yum update 一下,你的系统内核就更换成了centos的了。就跟你直接装的centos的系统差不多了。嘿嘿。 装完以后需要重启哟~ 注意事项: 必须注意事项 #uname -a 查看操作系统内核是32位还是64位(由此选择不同的下载目录) #cat /etc/issue 或者 cat /etc/redhat-release 查看系统安装的什么操作系统(由此选择不同的下载目录) 1.查看操作系统内核: #uname -a Linux IZP 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
2.查看系统安装的yum程序: #rpm -qa | grep yum yum-metadata-parser-1.1.2-2.el5 yum-3.2.19-18.el5 yum-security-1.1.16-13.el5 yum-rhn-plugin-0.5.3-30.el5 yum-updatesd-0.9-2.el5
3.卸载系统自带安装的yum程序: #rpm -qa | grep yum | xargs rpm -e --nodeps
4.下载CentOS的yum安装包: #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
5.安装下载点rpm安装包: #rpm -ivh *.rpm --nodeps
6.创建yum源: #vi /etc/yum.repos.d/CentOS-Base.repo ==================================== [base] name=CentOS-5 - Base baseurl=http://ftp.sjtu.edu.cn/centos/5/os/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#released updates [update] name=CentOS-5 - Updates baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released [addons] name=CentOS-5 - Addons baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful [extras] name=CentOS-5 - Extras baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages [centosplus] name=CentOS-5 - Plus baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/x86_64/ gpgcheck=1 enabled=0 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users [contrib] name=CentOS-5 - Contrib baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/x86_64/ gpgcheck=1 enabled=0 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 =======================================
7.测试yum是否成功: yum makecache 以后 yum update 一下 安装成功之后仍然报错。可能是如下原因: 如果升级python2.6后,不能使用YUM可使用如下办法解决. 恢复办法: rm -rf /usr/bin/python ln -s /usr/bin/python2.4 /usr/bin/python
或者修改: # vi /usr/bin/yum //来指定一下版本,更简单。 #!/usr/bin/python2.4 import sys |