redhat5.2 x64上使用yum

阅读更多
今天(010115)帮朋友在他的redhat5.2的服务器上用centos的yum替换原有的,测试成功,记录一下:
1、看看系统:
uname -a
Linux hostname 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.2 (Tikanga)


2、卸载掉自带的yum:
rpm -aq|grep yum|xargs rpm -e --nodeps


3、 下载centos的安装包
wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm
wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-20.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-13.el5.centos.noarch.rpm
wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm


4、生成/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-centos5

#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-centos5

#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-centos5

#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-centos5

#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-centos5

#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-centos5

5、换了一个Key
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

你可能感兴趣的:(CentOS,Linux,OS,Python,RedHat)