ARCH pacman更新错误:error: failed to commit transaction (conflicting files)

时间:2024-02-18 12:42:36

更新错误如下:

Proceed with installation? [Y/n] y
(39/39) checking package integrity                 [----------------------] 100%
(39/39) loading package files                      [----------------------] 100%
(39/39) checking for file conflicts                [----------------------] 100%
error: failed to commit transaction (conflicting files)
filesystem: /var/lock exists in filesystem
filesystem: /var/run exists in filesystem
Errors occurred, no packages were upgraded.

检查一下这2个是什么东西

[leajon@arch var]$ ls -ln /var/{run,lock}
lrwxrwxrwx 1 0 0 9 May  7 19:56 /var/lock -> /run/lock
lrwxrwxrwx 1 0 0 4 May  7 19:56 /var/run -> /run

是符号链接,检查一下这俩东西有没有被其他包使用

[leajon@arch var]$ pacman -Qo /var/{run,lock}
error: No package owns /var/run
error: No package owns /var/lock

删掉这二个软链接,然后更新,顺利完成!

[leajon@arch var]$ sudo rm -rf /var/lock /var/run && sudo pacman -Syu
.
.
.
.
.
.

(38/39) upgrading vim-runtime                      [----------------------] 100%
(39/39) upgrading vim                              [----------------------] 100%
[leajon@arch var]$