Arch Linux upgrade fails because some file exists in filesystem

From time to time, pacman refuses to upgrade because of a file conflict. Since it does not want to take the responsibility of overwriting an existing file which might be used by another package, it displays the following error:

error: failed to commit transaction (conflicting files)
freeimage: /usr/lib/ exists in filesystem
Errors occurred, no packages were upgraded.

In this case, pacman tries to install the package freeimage, which contains a file named, but detects that a file with the same name exists at the same location.

To solve this conflict, we first need to verify that this file is currently not owned by another package:

$ pacman -Qo /usr/lib/
error: No package owns /usr/lib/

The above message means we can safely (re)move this file. Since we are cautious people:

$ sudo mv /usr/lib/ /usr/lib/

We repeat this procedure each time we see this error, then the next pacman -Syu should go smoothly. If pacman -Qo should return something like this:

$ pacman -Qo /usr/lib/
/usr/lib/ is owned by freeimage 3.16.0-2

Then it is probably a bug!




No comment yet.

A remark, a suggestion? Do not hesitate to express yourself below. Just be courteous and polite, please.

If this field is left blank, you will appear as Anonymous.