Ask Your Question
2

Failed to obtain the transaction lock (logged in as: root).

asked 2015-09-30 03:36:37 -0500

roberto68 gravatar image

when I try to install anything this is the full message Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Failed to obtain the transaction lock (logged in as: root). The downloaded packages were saved in cache till the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: Could not run transaction. and I tried dnf clean packages but still the same, should I delete some file? no other process is runnin dnf. It downloaded packages just fine, but failed to isntall them with that error.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2016-01-17 13:15:21 -0500

mkungla gravatar image

This is something occouring once a while and has been reported as bug over several Fedora releases. These bug's have been closed and then reopened and so on, for instance Red Hat Bugzilla bug #1204488.

While searching the solution you most likely come across multitude of suggestions.
which may or may not work for you.

So most cases root cause of this problem is surely that previous dnf upgrade | install got interrupted.
it could be that you your self canceled the transaction by pressing Ctrl+c or other user was running transaction or any other reason out of million interrupted the transaction.

  • As @pnadk mentioned first thing indeed you could try to remove rm /var/cache/dnf/metadata_lock.pid

    However your problem might not disappear, for instance you don't have this lock file there. Or you deleted it and still have the same problem Error: Could not run transaction ...

  • You might have tried systemd-tmpfiles --remove dnf.conf

  • Or dnf clean all
  • Or If you ran dnf under a regular user, without the noroot plugin installed then install the plugin
    dnf install dnf-plugins-core
  • You might have tried to search dnf processes running and killing them kill pid, kill -9 pid, kill {x}
  • You might have tried to search cache files and deleting them manually

And still the same story...
Just before you pull your hairs out take a note:
You might have already solved the issue at first step just restart you PC and you are most likely good to go!

edit flag offensive delete link more
0

answered 2016-03-16 14:41:20 -0500

Nicholas gravatar image

updated 2016-03-16 15:16:08 -0500

I'm also expirencing this issue after running a sudo dnf clean all and sudo dnf remove clamav.

sudo dnf install clamav

Total size: 823 k
Installed size: 2.2 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] clamav-0.99-2.fc23.x86_64.rpm: Already downloaded                                  
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Failed to obtain the transaction lock (logged in as: root).
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Could not run transaction.

I've look through the system for any leftover pid files and can't seem to locate the lock.

Fedora release 23 (Twenty Three)
VERSION="23 (Workstation Edition)"
4.4.4-301.fc23.x86_64

1.1.7
Installed: dnf-0:1.1.7-2.fc23.noarch at 2016-03-14 15:08
Built : Fedora Project at 2016-03-09 16:45

edit flag offensive delete link more

Comments

Well, seems like a restart fixed this issue for me.

Nicholas gravatar imageNicholas ( 2016-03-16 17:54:25 -0500 )edit
0

answered 2015-10-01 02:19:30 -0500

pnadk gravatar image

A previous dnf update has been interrupted and it has left a lock file which prevents dnf from running now. Make sure no other updates are running, and then try this:

rm /var/cache/dnf/metadata_lock.pid
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-09-30 03:36:37 -0500

Seen: 6,865 times

Last updated: Mar 16 '16