吃豆人:存在于文件系统中

吃豆人:存在于文件系统中

使用 来安装软件包时pacman,我看到:

error: failed to commit transaction (conflicting files)
station: /usr/bin/station exists in filesystem

我如何告诉pacman仍然安装该软件包,覆盖现有文件?

答案1

检查哪个包包含文件名:

pacman -Qo filename

如果是另一个包,则提交错误报告:具有冲突文件的包应将自己标记为导致CONFLICTS询问pacman您是否希望替换冲突的包。

如果文件不属于任何包,请重命名或删除它们。


如果你确定你知道自己在做什么,您可以使用该--overwrite选项,例如:

pacman -S package-name --overwrite /usr/bin/station 

或者

pacman -S package-name --overwrite '*'

手册页说:

   --overwrite <glob>
       Bypass file conflict checks and overwrite conflicting files. If the
       package that is about to be installed contains files that are
       already installed and match glob, this option will cause all those
       files to be overwritten. Using --overwrite will not allow
       overwriting a directory with a file or installing packages with
       conflicting files and directories. Multiple patterns can be
       specified by separating them with a comma. May be specified
       multiple times. Patterns can be negated, such that files matching
       them will not be overwritten, by prefixing them with an exclamation
       mark. Subsequent matches will override previous ones. A leading
       literal exclamation mark or backslash needs to be escaped.

相关内容