Home Arch Linux How To Solve “error: failed to commit transaction (conflicting files)” In Arch Linux

How To Solve “error: failed to commit transaction (conflicting files)” In Arch Linux

By sk
Published: Last Updated on 33.6K views

It's been a month since I upgraded my Arch Linux desktop. Today, I tried to update my Arch Linux system, and ran into an error that said "error: failed to commit transaction (conflicting files) stfl: /usr/lib/libstfl.so.0 exists in filesystem". It looks like one library (/usr/lib/libstfl.so.0) that exists on my filesystem and pacman can't upgrade it. If you're encountered with the same error, here is a quick fix to resolve it.

Solve "error: failed to commit transaction (conflicting files)" In Arch Linux

You have three options. 1. Simply ignore the problematic stfl library from being upgraded and try to update the system again. Refer this guide to know how to ignore package from being upgraded. 2. Overwrite the package using command:

$ sudo pacman -Syu --overwrite /usr/lib/libstfl.so.0

3. Remove stfl library file manually and try to upgrade the system again. Please make sure the intended package is not a dependency to any important package. And also check the archlinux.org there are mentions of this conflict.

$ sudo rm /usr/lib/libstfl.so.0

Now, try to update the system:

$ sudo pacman -Syu

I chose the third option and just deleted the file and upgraded my Arch Linux system. It worked just fine!

Related read:

You May Also Like

5 comments

Anders February 28, 2019 - 2:23 am

I did the same (remove the conflicting file), but instead of deleting it, I just renamed the file to originalfilename.old, to have a way of going back if things broke.

Reply
Nate Quibler August 2, 2019 - 3:20 pm

So what if the existing file list is extensive (i’ve installed a package with make install, and now i want to go back to the package in the Arch repos)?
How do you overwrite all without prompt and without writing the path to all files that need to be overwritten?

Reply
hulutreck83 April 18, 2020 - 2:31 pm

Option 2 works like a charm, many thanks.

Reply
José Geraldo Gouvea November 3, 2020 - 8:08 am

# pacman -S package > list

Open the list file and remove the beginning and the end of every line containing a file name. Then delete the last line and the heading lines before the file list. Save and close.

Next do

# rm $(cat list)
# pacman -S package

Works like a charm for long lists. You can always use an editor, of course, or sed, if you are so inclined (but if you can use Sed, then you problably know the answer already.

Reply
mike December 5, 2022 - 1:21 pm

removing the conflicting file worked for me (option 3); thank you

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More