Why does yum update command fail with OSError: [Errno 2] No such file or directory: '/var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages'

Solution Verified - Updated -


  • yum update command is failing with the below error.

    Downloading packages:
    Traceback (most recent call last):
     File "/bin/yum", line 29, in <module>
       yummain.user_main(sys.argv[1:], exit_code=True)
     File "/usr/share/yum-cli/yummain.py", line 375, in user_main
       errcode = main(args)
     File "/usr/share/yum-cli/yummain.py", line 281, in main
       return_code = base.doTransaction()
     File "/usr/share/yum-cli/cli.py", line 683, in doTransaction
       problems = self.downloadPkgs(downloadpkgs, callback_total=self.download_callback_total_cb)
     File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 2492, in downloadPkgs
       presto = DeltaInfo(self, pkgs, adderror)
     File "/usr/lib/python2.7/site-packages/yum/drpm.py", line 146, in __init__
       for rpmfn in os.listdir(po.repo.pkgdir):
    OSError: [Errno 2] No such file or directory: '/var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages'


  • Red Hat Enterprise Linux 7

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