Switching from RHEL 5-server to CentOS 5-everything

If it doesn't fit in another category, ask it here.
adebened
Posts: 290
Joined: 2007/04/16 22:03:20

Switching from RHEL 5-server to CentOS 5-everything

Post by adebened » 2007/04/16 22:11:49

Hi all,

I have a bit of an odd question given that RHEL 5 just came out. I was wondering how hard it would be to switch an existing computer from RHEL 5 to CentOS 5? If a computer is running RHEL 5 server core, can it be switched over to CentOS 5 server+workstation (i.e. have access to everything, not just the server components)? Are the RHEL registration numbers going to be a problem? I am considering switching a server over and I'm just worried I might screw up my rpm/yum database and break things. If anyone could let me know the exact steps to do a switchover from RHEL5 server core to CentOS5 server+workstation I'd really appreciate it. By the way, congrats to all involved with this project. I really like it.

Thank you,
Andrew

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by Lenard » 2007/04/17 14:38:52

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-0.0.el5.centos.2.i386.rpm
http://isoredirect.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.0.0-2.i386.rpm

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.

adebened
Posts: 290
Joined: 2007/04/16 22:03:20

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by adebened » 2007/04/17 17:08:15

Hi Lenard,

Thank you very much for the information. I hope you dont mind but I have just a few questions:
I tried yum --enablerepo=CentOS-5-Base and CentOS5 but I received the message: Error getting repository data for CentOS5, repository not found. How do I use the enablerepo switch?

I enabled the rep "by hand" by setting enabled=1 in the sample files you gave me. I ran the RedHat add/remove software utility (pirut, I think) and it showed the extra packages. When I tried to install one though it gave me the message:
Missing Dependency: openoffice.org-writer = 1:2.0.4-5.4.17 is needed by package openoffice.org-emailmerge
Missing Dependency: openoffice.org-pyuno = 1:2.0.4-5.4.17 is needed by package openoffice.org-emailmerge
but I have both of these packages already installed (I installed them using the rpms available on RHN).

I suspect this is related to the enablerepo issue but I'm not sure.

Thank you in advance,
Andrew

adebened
Posts: 290
Joined: 2007/04/16 22:03:20

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by adebened » 2007/04/18 06:11:18

Actually, I found out the reason for the upgrade failure. I had enabled base instead of upgrade and the updated package was available in the updates repo. I enabled the update repo instead and installed it from the command line with "yum" (I'm away from the terminal so I cant test pirut) and it worked. I notice that if I type yum update it tells me that a lot of packages need updating. Most of them I already have but the difference is that the ones yum tells me about have centos in their name. Should I ignore these? Should I only enable the updates repo? (i.e. is the base repo static?) Also, will my system periodically check the CentOS repo for updates and alert me of them or do I have to do manual checks? What about if I switched to CentOs as per the above instructions? (re: the auto check). Should I be worried about conflicts between CentOS and RHN packages? I'm sorry for all the questions. I'm just trying to figure out if I should just add the CentOS repos or if I should do the switch over. Any advice on which avenue to pursue would be welcomed.

Thank you in advance,
Andrew

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by Lenard » 2007/04/18 11:55:30

1. Do not leave the CentOS repos enabled by default if your system is still registered with RHN and is RHEL5.

2. Reading of the manpage (man yum) revels;

[code]
--enablerepo=repoidglob
Enables specific repositories by id or glob that have been dis-
abled in the configuration file using the enabled=0 option.
Configuration Option: enabled
[/code]

Example: yum install foo --enablerepo=CentOS5plus

3. Please review:

http://wiki.centos.org/HowTos/PackageManagement/YumOnRHEL
http://mirror.centos.org/centos/4/docs/html/yum/

4. If you want to use CentOS as your OS then please install the yum and related packages for CentOS and unregister the system from RHN. Remove the yum-rhn-plugin if switching to CentOS5 after unregistering the system from RHN

Yes the CentOS-Base repo and the the RHEL5 base repo are static. The yum-updated if installed and configured will install updates automatically as they become available.

If you switch to CentOS leave the CentOS-base repo and other CentOS repos enabled, you will not need my example centOS5 repo file. It would be a good idea to change all the RHEL packages over to the CentOS packages, it is alot easier to do this then editing the /etc/yum.conf file to exclude them. It also makes 'life easier' not to see the CentOS vs RHEL packaging conflicts all the time.

adebened
Posts: 290
Joined: 2007/04/16 22:03:20

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by adebened » 2007/04/18 23:54:18

Thank you. I appreciate the info. I did as you said and everything seems to be working very well. Thanks a lot! The only (very minor) hang-up was that, after updating the release files, one has to do a "yup update --exclude=desktop-backgrounds-basic" since there are a few files in here that conflict with some RedHat ones. After the yum updating, you can update using the "rpm -Uvh --replacefiles" command. This doesn't break anything since the files are just a couple of pictures that get replaced with CentOS's version.
Thanks again for all your help.

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by Lenard » 2007/04/19 12:12:08

Your welcome glad to help.

centospede
Posts: 52
Joined: 2007/01/15 01:40:02

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by centospede » 2007/11/08 08:32:12

i came into this post late but have the same question a couple of months later. i've read through the posts but not sure i completely understand them.

i have a come into a system with RHEL 5 installed. the subscription is ending and I don't want to renew it. i'd like to simply start performing yum centos 5 updates on the same system. i don't want to have to reinstall it centos 5 from scratch. would someone be able to give me a step by step just a little more detailed than what was presented in the previous posts? i'm not sure i completely follow it.

obviously i must enable the centos 5 repos.

- which means i probably need to disable the rhel 5 repos right? how do i do that?

- per prior posts: since the rhel and centos 'base' is supposed to be the same, can i just start updating with the centos base and will that update seamlessly over the existing rhel base? or is there going to be manual removing of rpms and then readding them again?

- same for standard updates. do i just enable centos updates and they magically take care of every thing updating the EXISTING rhel 5 packages?

I ask because if the rpms have different internal names (e.g. RHEL 5 and CentOS 5) wouldn't the updates really be complete Centos rpm reinstalls of the RHEL rpms that already live on my system? meaning that i'd have duplicates of every rpm installed on my system side by side - 1 RHEL and the other CentOS? sorry if i don't follow this.

- when you use the yum -enablerepo option, does that just **temporarily** enable the repo 1 time for the current exectuion of yum or does it actually change the repo config file enabled switch to 1 making it a permanent configuration change?

those are specific questions but a step by step would be helpful if anybody can muster up the patience to post it up.

thanks much

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by Lenard » 2007/11/08 17:58:27

Everything I said in my first reply applies, just make sure you enable all the CentOS repos. You may want to first update to RHEL5.1 if your subscription is still valid;

$ cat /etc/*release
Red Hat Enterprise Linux Client release 5.1 (Tikanga)

jbennet
Posts: 7
Joined: 2007/11/08 23:30:50

Re: Switching from RHEL 5-server to CentOS 5-everything

Post by jbennet » 2007/11/09 08:51:05

i can confirm this method works for going oracle unbreakable -> centos4

Post Reply