Home Linux troubleshooting Solve “ERROR: ‘pacman’ failed to install missing dependencies” In Arch Linux

Solve “ERROR: ‘pacman’ failed to install missing dependencies” In Arch Linux

By sk
Published: Last Updated on 6.6K views

The other day I tried to install a package from AUR using Yay helper program. The package I tried to install has many Python dependencies. Unfortunately, I couldn't install it and Yay kept throwing the following error. I thought the problem would be solved if I remove the conflicting packages. But, I don't want to break the system. Here is the output error message when I tried to install a program from AUR:

 error: failed to commit transaction (conflicting files)
 python-tabulate: /usr/bin/tabulate exists in filesystem
 python-tabulate: /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc exists in filesystem
 python-tabulate: /usr/lib/python3.6/site-packages/tabulate.py exists in filesystem
 Errors occurred, no packages were upgraded.
 :: Building torrench package(s)...
 ==> Making package: torrench 1.0.56-1 (Mon Oct 23 15:46:37 IST 2017)
 ==> Checking runtime dependencies...
 ==> Installing missing dependencies...
 error: target not found: python-tabulate
 ==> ERROR: 'pacman' failed to install missing dependencies.

As you can see in the above output, the following three packages were the ones that causing the problem.

  1. /usr/bin/tabulate
  2. /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc
  3. /usr/lib/python3.6/site-packages/tabulate.py

Solve "ERROR: 'pacman' failed to install missing dependencies" In Arch Linux

To me, deleting the problematic packages fixed the problem. However, it is always recommend to check the problematic files are not owned by some other packages. Because If it is owned by some other program, deleting them is bad idea. So, you need to find those conflicting files are not owned by any other packages. The pacman command can easily find out if a file is owned by other packages in your Arch Linux system.

In my case, I checked whether the above mentioned files are owned some other packages as shown below.

$ sudo pacman -Qo /usr/bin/tabulate

Sample output:

error: No package owns /usr/bin/tabulate
$ sudo pacman -Qo /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc

Sample output:

error: No package owns /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc
$ sudo pacman -Qo /usr/lib/python3.6/site-packages/tabulate.py

Sample output:

error: No package owns /usr/lib/python3.6/site-packages/tabulate.py

As you can see, all of the above commands showed me that those files are not owned by any packages. So, I simply deleted them one by one.

$ sudo rm /usr/bin/tabulate
$ sudo rm /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc
$ sudo rm /usr/lib/python3.6/site-packages/tabulate.py

Done! Now, I can be able to install all packages with Python dependencies. For safety a precaution, backup those conflicting files before deleting them. You can restore them just in case if there are any problems after deleting them.

You May Also Like

2 comments

simon October 31, 2021 - 1:35 am

did not work only says now
$sudo rm /usr/bin/tabulate
rm: cannot remove ‘/usr/bin/tabulate’: No such file or directory

Reply
sk October 31, 2021 - 11:07 am

If ‘/usr/bin/tabulate’ file doesn’t exist, it could be different file. Try to find and delete the correct file.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More