CentOS 4.2 Welcome en 3Recently I was using a canned VM that had RedHat EL6 loaded on it, and needed to add a package, only to find that the package had been moved to the RedHat base repository.

 

 

 

 

First, I tried simply installing what I needed:

So the first thing I noticed was that this was a cloned machine that has a bad systemid, so it wants to be registered with RedHat. Just to get rid of the initial message, I tried removing the systemid from /etc/sysconfig/rhn:

So next I needed to add the CentOS repositories and remove the RedHat ones (since I have no subscription for this VM. So going to the /etc/yum.repos.d, I simply renamed the .repo to .repo.save:

Next, I copied the CentOS repo files from an existing machine, which put the basic file in place, but since this file relies on the $releasever, it still errors out:

In order to get this to work, I simply have to edit the CentOS-Base.repo file again, and replace the variable with the number of the release I want:

In “vi” I just typed:

And the file was updated to:

This now sets the repositories to point properly, so running the command again should work, but of course I forgot the GPG file:

So all I need to do is add the signature file, which I can do using rpm directly (there’s probably a way to do this with yum, but I don’t know it, so I’ll resynch after the import):

Once that is done, the update succeeds:

Then to make the system completely up to date, you just run “yum update”, and voila, you have a running CentOS box.