$ pacman -Syu
$ pacman -Ss <search string>
$ pacman -S <package>
Where <package> is the package name as found with -Ss.
$ pacman -Qs <package>
$ pacman -Ql <package>
Where <package> is the package name as found with -Qs.
error: failed to commit transaction (conflicting files) libname: /insert/file/name/here exists in filesystem Errors occurred, no packages were upgraded.
Why this is happening:
pacman has detected a file conflict, and by design, will not overwrite files for you. This is a design feature, not a flaw.
It is the user’s responsibility to maintain their system, not the package manager’s. (pacman -Qo may be invoked to query which package owns the file, if any.)
What can be done to solve this:
The issue is usually trivial to solve. A safe way is to firstly check if another package owns the file (pacman -Qo <full file path>). If the file is owned by another package file a bug report If the file is not owned by another package rename (or remove) the the file which ‘exists in filesystem’, and reissue the pacman -Syu command. If all goes well, the file may then be removed.
See also: ArchLinux Forum.
The database is locked, unlock it with:
$ rm /var/lib/pacman/db.lck