Redhat 5 Subscription Manager and/or YUM Errors

Problem Description : 

Yum commands fail with Config Error: File contains no section headers.file: file://///etc/yum.repos.d/redhat.repo, line: 9'[]\n' error and/or the RHEL 5 server is unable to register a subscription. At the top of the subscription manager window you may see a message next to certificate status starting that 'You have 1 product with an invalid entitlement certiticate'. It will not let you add any of the available subscriptions. May also see a red box under the product column and a status showing 'Not Subscribed'. When pressing the unregister button at the top it says that errors were encountered 'Unit <&ltunit number>> has been deleted.

 

 

 Resolution : 

 

Run these commands to see what error shows...

 

# subscription-manager list --available

 

# subscription-manager list --consumed

 

Likely will see something like this...

 

[root@banweb ~]# subscription-manager list --available

/usr/lib64/python2.4/site-packages/rhsm/certificate.py:123: DeprecationWarning: Call to deprecated function: __init__

 category=DeprecationWarning)

Error: You need to register this system by running `register` command. Try register --help.

 

[root@banweb ~]# subscription-manager list --consumed

/usr/lib64/python2.4/site-packages/rhsm/certificate.py:123: DeprecationWarning: Call to deprecated function: __init__

 category=DeprecationWarning)

No Consumed subscription pools to list

 

The error /usr/lib64/python2.4/site-packages/rhsm/certificate.py:123: DeprecationWarning: Call to deprecated function: __init__ category=DeprecationWarning) sugggest a corrupt subscription-manager package

 

Register on RHN Classic using Application > System Tools > RHN Registration. Verify the server is listed on the Redhat customer portal under Subscriptions > RHN Classic.

 

Delete redhat.repo from /etc/yum.repos.d/

 

# rm -rf /etc/yum.repos.d/redhat.repo

 

Re-install subsciption-manager packages, and update them fully:

 

# yum reinstall subscription-manager

# yum update subscription-manager

 

Verify that you can access Packager Manager from Redhat server

 

Once you do that you should be able to unregister from RHN Classic and subscribe through subscription manager. To do so delete your system off the RHN Classic from the Customer portal. Then run the folliwng command to get rid of any traces of classic....

 

rm /etc/sysconfig/rhn/systemid*

 

Now open subscription manager and register the system.

 

May have to wait a few minutes in order for software to show under Add/Remove Software. 

 

 

 

 

 Revision Date : 8/22/2014