yum commands fail with Config Error: File contains no section headers.file: file://///etc/yum.repos.d/redhat.repo, line: 9'[]\n'

Solution Verified - Updated -

Issue

After a "yum update" got interpreted, all yum commands return the following error:

Config Error: File contains no section headers.
file: file://///etc/yum.repos.d/redhat.repo, line: 9
'[]\n'

The /etc/yum.repos.d/redhat.repo file now looks as follows:

# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

[]
gpgcheck = 1
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/6951533640253412352-key.pem
sslclientcert = /etc/pki/entitlement/6951533640253412352.pem

Environment

  • Red Hat Enterprise Linux 5.7 and above
  • Red Hat Subscription Manager registration (RHSM)
  • subscription-manager-0.98.16.3-1.el5_8.x86_64
  • python-rhsm-1.0.10-1.el5.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.