Difference between revisions of "Pacman troubleshooting"

no edit summary
imported>Fhdk
imported>Cscs
Line 98: Line 98:


After that try running '''sudo pacman -Syu''' to see if the errors were resolved.
After that try running '''sudo pacman -Syu''' to see if the errors were resolved.
== Failed to commit transaction (conflicting files) ==
'''If you cant can't install or update a package because of an error like this:'''
error: could not prepare transaction
error: failed to commit transaction (conflicting files)
libname: /insert/file/name/here exists in filesystem
Errors occurred, no packages were upgraded.
Then the package manager, pacman, has detected an unexpected file that already exists on the disk.
'''Why is this happening?'''
By design pacman will '''not''' overwrite files that already exist. This is a design feature, not a flaw - package managers are designed to keep track of installed files.
This issue normally happens because you've manually added, copied, or created a file. It can also happen when you install software using a downloaded executable, run a make install, or use a third-party package system such as conda. It also occurs when you install an AUR package which installs files that conflict with a repo package.
When using a third-party installer you should always specify an alternative installation location, such as under your home directory, or under /opt or /usr/local/. Never install directly under / or /usr.
'''How can I fix this?'''
The first step is to identify which, if any, package owns the file. This can be easily done with:
pacman -Qo /path/to/file
If this identifies a conflicting package you can decide to remove it with pacman -R. If no package is identified you can delete the file (or move it to a backup location).
'''Where can I read more?'''
This post was inspired by (and adapted from):
https://bbs.archlinux.org/viewtopic.php?id=56373143
The above post also has links to further reading.




Anonymous user