yum fails with [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>

Solution Verified - Updated -

Issue

  • yum command fails with following error,
# yum repolist
Loaded plugins: rhnplugin, security
http://local/path/to/yum/repository/repomd.xml: [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: myrepo. Please verify its path and try again

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5
  • Red Hat Network (RHN)
  • Red Hat Satellite

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content