Manual intevention needed: python-cairo, Conflicting files during update

When I recently updated my laptop as well, python cairo was updated without any problems.

For me, the “standard procedure” for these kinds of situation is this:

  1. Check which package owns conflicting file:
    pacman -Qo <conflicting_file>
  2. If a package owns that file, file a bug report. Otherwise, simply rename the file (just in case you need a copy of it) and then perform the update again.
3 Likes

thanks!!

1 Like

Hello and welcome @emox :wave:

1 Like

Did have the problem. Starting doing a general search to see if it was a known issue, and this forum was one of the very first hits I get. You guys are just on this. :slight_smile:

2 Likes

Thank you for this entry :slight_smile:

1 Like

I started updating the packages yesterday morning. At first, I only found this https://forum.archlabslinux.com/t/solved-update-failed-error-python-cairo/6961 as a solution, and the meaningless Arch forum post. :slight_smile:

same problem here python-cairo blocked all package upgrades… can confirm your command fixed it. package upgrades installed fine.

2 Likes

and… welcome on the purple side @leisefuxx :enos:

@dalto Thank you so very much … phenomenal assistance to our community.

2 Likes

This forum is simply the best thing about EOS. I am 66 years old, and started using Linux last year. Distro hopped until I heard about this forum. Leaning more and more by using EOS. I had the update issue this morning and found the fix in less the 30 seconds.
Cheers

6 Likes

Thank you!
I got this error, come to the forum for help and seeing this pinned, amazing :partying_face:

2 Likes

https://wiki.archlinux.org/title/Pacman … )%22_error

3.1 “Failed to commit transaction (conflicting files)” error

If you see the following error: [1]

error: could not prepare transaction
error: failed to commit transaction (conflicting files)
package: /path/to/file exists in filesystem
Errors occurred, no packages were upgraded.

This is happening because pacman has detected a file conflict, and by design, will not overwrite files for you. This is by design, not a flaw.

The problem is usually trivial to solve. A safe way is to first check if another package owns the file (pacman -Qo _/path/to/file_). If the file is owned by another package, file a bug report. If the file is not owned by another package, rename the file which ‘exists in filesystem’ and re-issue the update command. If all goes well, the file may then be removed.

If you had installed a program manually without using pacman, for example through make install, you have to remove/uninstall this program with all of its files. See also Pacman tips#Identify files not owned by any package.

Every installed package provides a /var/lib/pacman/local/_package-version_/files file that contains metadata about this package. If this file gets corrupted, is empty or goes missing, it results in file exists in filesystem errors when trying to update the package. Such an error usually concerns only one package. Instead of manually renaming and later removing all the files that belong to the package in question, you may explicitly run pacman -S --overwrite _glob_ _package_ to force pacman to overwrite files that match _glob_.

Warning: Generally avoid using the --overwrite switch. See System maintenance#Avoid certain pacman commands.

2 Likes

Interesting. I got that error and didn’t know --overwrite

So, I simply deleted /usr/lib/python3.10/site-packages/cairo/__pycache__/ and then update went fine.

You can also do that in cases when the file can be temporarily removed safely.

Definitely worked. Thanks!

2 Likes

It seems the culprit is needed by “meld”:

[xx@hp2000pc ~]$ sudo pacman -Ss python-cairo

extra/python-cairo 1.23.0-2 [installed: 1.23.0-1]
    Python bindings for the cairo graphics library

community/python-cairocffi 1.4.0-1
    cairocffi is a CFFI-based drop-in replacement for Pycairo, a set of Python bindings and
    object-oriented API for cairo.

community/python-cairosvg 2.5.2-4
    SVG converter based on Cairo. It can export SVG files to PDF, PostScript and PNG files

[xx@hp2000pc ~]$ sudo pacman -Rs python-cairo
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing python-cairo breaks dependency 'python-cairo' required by meld

So I uninstalled “meld”, then the upgrade went down as expected.

IIRC “meld” was pre-installed from ISO; I did not go online to install EndeavourOS. I haven’t used it because I don’t know what it’s for LOL.

@mnrvovrfc

You don’t really have to uninstall python-cairo to solve this—not the best practice, in my opinion. Next time there’s a conflicting file during an update, just run pacman -Qo <file_Name> to see which package owns the file. If no packages own the file, just rename the file (just in case you need a copy of it) and then run the update again.

You could use the --overwrite flag with pacman, but this is discouraged by the arch wiki and for good reason.

2 Likes

@manfredlotz

You are extremely lucky that the file wasn’t a part of some other package. Next time, before you delete anything, check with pacman -Qo <file_name> first.

But in this case, it’s okay because the directory you deleted is a __pycache__ directory, which contains bytecodes that are generated by python—those bytecodes could be generated again, so there’s no problem there.

2 Likes

Actually, I couldn’t imagine that the __pycache__ directory could be a part of another package. Very unlikely.

And yes, I did check before deleting it. :slight_smile: