Dec 05 2008

rhel5 转到 centos5

Category: 技术ssmax @ 13:04:57

rhel5的yum source 不好找,还是直接用centos的方便,转换一下就好了

 

It is not hard to switch to CenOS5, just install a couple of rpm packages and your done, but you really do not have to switch. It is possible to add the CentOS repos to your yum configuration. Sample /etc/yum.repos.d/ CentOS5.repo (sample name) file below;

[CentOS5 base]
name=CentOS-5-Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

[CentOS5 updates]
name=CentOS-5-Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

[CentOS5plus]
name=CentOS-5-Plus
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

Notice the CentOS5 repos are by default disabled. This is a good idea, one can enable the repos at anytime using the yum –enablerepo switch. It might be a good idea to import the CentOS5 key (see the example repo file above) and enable the gpgcheck;

rpm –import http://isoredirect.centos.org/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

If you really want to switch to CentOS then download and install the;

For 64-bit based system:

http://isoredirect.centos.org/centos/5/os/x86_64/CentOS/centos-release-5-0.0.el5.centos.2.x86_64.rpm
http://isoredirect.centos.org/centos/5/os/x86_64/CentOS/centos-release-notes-5.0.0-2.x86_64.rpm

For 32-bit based system:

http://isoredirect.centos.org/centos/5/os/i386/CentOS/centos-release-5-2.el5.centos.i386.rpm
http://isoredirect.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.2-2.i386.rpm

上面的地址会经常变的,升级版本就会变,所以直接到 http://isoredirect.centos.org/centos/5/os/
里面找

A couple of additional packages might be needed but these should get you started nicely. Test install them to find out if you need to add any packages first, example;

rpm -Uvh centos-release*.rpm –test

You might want to remove the Red Hat release packages first, or you may have to use the force or replace packages switch to really install, for example;

rpm -Uvh centos-release*.rpm –force [–replacepkgs]

Of course the example repo file above would not be needed if you really switch. It would be an excellent idea to first unregister any systems from RHN before switching, this way you can re-register other systems on RHN if desired.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.