pacman: error: failed to commit transaction

# pacman -Syu
后出现上面错误以及类似下面的错误:

error: failed to commit transaction (conflicting files)
wicd: /usr/lib/python2.7/site-packages/wicd/__init__.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/backend.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/configmanager.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/dbusmanager.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/logfile.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/misc.pyo exists in filesystem

首先检查上面报错的文件是否被其他的包所使用:

# pacman -Qo full_file_path

如果出现:

xxx is owned by xxx

可以报 bug 了;如果没有,可以直接把他们给删除或者强制升级包。

前者,将错误复制到 error 文件中:

# cat error | awk '{print $2}' > error.log
# rm `cat error.log`

按后一种方法的话,直接升级:

# pacman -Sf wicd

最后再次执行:

# pacman -Syu

可能是没有经常升级导致的上面的错误,所以,没事 Syu 应该能避免上述错误。

参考:
http://thinkingoutloud.gr/2011/01/archlinux-pacman-error-failed-to-commit-transaction-conflicting-files/