How to install the main repositories for RHEL6

repositoryrhel6yum

We've setup RHEL6 on a new server. As far as we can tell, our subscription is all setup properly. However, when I run yum repolist, it doesn't show any repositories. /etc/yum.repos.d/redhat.repo is empty. I tried pasting in the content from another RHEL6 server's redhat.repo but as soon as I run yum, it wipes it out again. I just need to get the basic RedHat repositories setup so I can install packages.

To make sure I wasn't having a subscription issue. I re-registered and re-subscribed. I get all the same results.

# subscription-manager register --force
# subscription-manager subscribe --pool=*redacted*

When I log in to RedHat customer portal, it shows that subscription as active.

Using the GUI, I went to System > Administration > Red Hat Subscription Manager. Under the 'Products' tab, it did not show any products.

When I run yum update, here's what I get:

# yum update
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Setting up Update Process
No Packages marked for Update

contents of /etc/yum.conf

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3

contents of /etc/yum/pluginconf.d/rhnplugin.conf:

[main]
enabled = 0
gpgcheck = 1

Best Answer

Here's how I fixed the issue, at least temporarily. I copied the /etc/yum.repos.d/redhat.repo file from another working rhel6 server. Then I replaced all of the instances of sslclientkey and sslclientcert with the .pem files on this server. Then I renamed the .repo file to avoid it being wiped out on update. By doing that, I am able to install all packages as expected.

I'll have to continue to work with support to get the root of this problem solved.

UPDATE

Red Hat support finally got back to me with the following instructions which fixed the root of the problem and all is well:

Upon inspection of your registered systems we are showing you currently have them registered through RHSM and one of those systems is also registered through RHN classic.

Navigate to the following location after logging in through the customer portal and delete both systems by checking the boxes and clicking 'Delete Selected' on the bottom left:

https://access.redhat.com/management/consumers/

Once the above is completed locally in a terminal as root on the system 'GH-Server-5' issue the following commands:

rhn_register

The above command will open a terminal-tui for RHN Classic registration and ask for a username and password. These are your customer portal login and password. Also make sure to check all available update unless you require limited updates.

When the terminal based tui completes your registration issue the following commands to clean out yum's cache and add the correct repositories, and then finally update:

yum clean all
yum repolist
yum update