yum or rpm fails with errors can't create transaction lock on / (Is a directory) or <rpm> was supposed to be removed but is not!

Solution Verified - Updated -

Issue

  • When installing any package using yum or rpm, the following errors appear:
# rpm -ivh /katello-ca-consumer-latest.noarch.rpm
error: can't create transaction lock on / (Is a directory)

Or

# yum remove wget -y
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7_6.1 will be erased
--> Finished Dependency Resolution
rhel-7-server-extras-rpms/x86_64                                                                                     | 3.4 kB  00:00:00
rhel-7-server-optional-rpms/7Server/x86_64                                                                           | 1.9 kB  00:00:00
rhel-7-server-rpms/7Server/x86_64                                                                                    | 2.2 kB  00:00:00

Dependencies Resolved

============================================================================================================================================
 Package                     Arch                          Version                                   Repository                        Size
============================================================================================================================================
Removing:
 wget                        x86_64                        1.14-18.el7_6.1                           installed                        2.0 M

Transaction Summary
============================================================================================================================================
Remove  1 Package

Installed size: 2.0 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
wget-1.14-18.el7_6.1.x86_64 was supposed to be removed but is not!
  Verifying  : wget-1.14-18.el7_6.1.x86_64                                                                                              1/1

Failed:
  wget.x86_64 0:1.14-18.el7_6.1

Complete!

Environment

  • Red Hat Enterprise Linux
  • rpm or yum installation

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