Can't update due to conflicting files

Hi,
I tried running sudo pacman -Syu today and get the following error:

error: failed to commit transaction (conflicting files)
eos-bash-shared: /usr/bin/pkginfo exists in filesystem (owned by python-pkginfo)
Errors occurred, no packages were upgraded.

Does anyone know how to solve it?

Please see:

1 Like

Make sure to read the earlier comment.

In addition, keep in mind that never run pip commands as sudo as they will install files to system directories. This will lead to a conflict when the same package is installed via pacman. When installing packages from pip, run the command as normal user. Binaries will be installed at ~/.local/bin. Add this to your path variable (if its not there).

As an immediate measure, I would uninstall the package in question via pip as sudo. I would do this on any other package that reports this problem.

When installing python packages, search for it in the arch repo. Most major packages are available. If you need to get it via pip, then don’t run the pip install command as sudo.

2 Likes

This is what confuses me as well, I only install python packages via Poetry (without sudo) or from the arch repo.

I dont even have pip installed it would seem;
pacman -Qi python-pip
error: package ‘python-pip’ was not found

so I cant uninstall via pip.

The only aur package I have is opensnitch. Though it doesn’t list python-pkginfo as a dependency.

I guess I can overwrite it as described in the FAQ just don’t want to mess up my system.

Alternatively rename the file:

sudo mv /usr/bin/pkginfo /usr/bin/pkginfo.orig

Then run:

sudo pacman -Syu

When all is properly done, remove the old file:

sudo rm /usr/bin/pkginfo.orig

2 Likes

Thank you for all your help, I moved the file and it seems to have worked.

3 Likes

IMPORTANT INFO concerning this and similar errors about file /usr/bin/pkginfo conflict:

The error is real!

And the fix requires manual intervention if you have deleted the existing file /usr/bin/pkginfo which is part of python-pkginfo.

The error is caused by my mistake of releasing another file with the same name as a part of package eos-bash-shared. Sorry about that, and thanks for the report!
Unfortunately I didn’t have package python-pkginfo installed, so I didn’t see the conflict.

Manual intervention

If you have already deleted the “old” version of /usr/bin/pkginfo, you need to manually run these commands in this order:

yay -Syu                   # Update until package eos-bash-shared is 1.5.1-1 or newer!
pacman -Q eos-bash-shared  # Make sure the version is as mentioned above!

yay -S python-pkginfo      # Re-install corrupted package.

If you find another problem regarding the conflict of file /usb/bin/pkginfo, please report here as soon as possible!

Just to add on to what @manuel pointed out.

When a conflict is owned by another package you shouldn’t just overwrite it or rename it. That means there is a legitimate packaging situation you need to resolve.

If the conflicting file is not owned by a package you can consider options like overwriting depending on the situation.

2 Likes

I stand corrected. Shame on me for overlooking that rather important part.