Getting "AttributeError: 'module' object has no attribute 'Cmd'" when using yum

Solution Verified - Updated -

Issue

Getting following traceback when using yum :-

# yum update
Traceback (most recent call last):
  File "/usr/bin/yum", line 28, in <module>
    import yummain
  File "/usr/share/yum-cli/yummain.py", line 34, in <module>
    import cli
  File "/usr/share/yum-cli/cli.py", line 34, in <module>
    import shell
  File "/usr/share/yum-cli/shell.py", line 31, in <module>
    class YumShell(cmd.Cmd):
AttributeError: 'module' object has no attribute 'Cmd'

Environment

  • Red Hat Enterprise Linux7

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