我在桌面上的 Manjaro linux 软件更新方面遇到了困难。我想要执行系统更新,我会转到更新应用程序,或者更新应用程序会通知我许多未完成的软件更新,然后我开始更新过程。然而,下载更新后,我通常会收到一条消息,说我的一些 python 包依赖于其他 python 包,并且将具有“依赖周期”。我“提交”该交易是为了表明我知道该问题,但“交易失败”的情况总是发生。
我已尝试仅对某些软件包进行部分升级作为解决方法,但它仍然因事务失败而失败。
这是 pacman -Syu 的运行:
sudo pacman -Syu
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
:: Starting full system upgrade...
:: Replace geoclue2 with extra/geoclue? [Y/n] y
:: Replace libmariadbclient with extra/mariadb-libs? [Y/n] y
:: Replace libsystemd with core/systemd-libs? [Y/n] y
:: Replace pamac with extra/pamac-gtk? [Y/n] y
:: Replace xorg-mkfontdir with extra/xorg-mkfontscale? [Y/n] y
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: bashrc-manjaro will be installed before its bash dependency
warning: dependency cycle detected:
warning: harfbuzz will be installed before its freetype2 dependency
warning: dependency cycle detected:
warning: libglvnd will be installed before its mesa dependency
warning: dependency cycle detected:
warning: nvidia-utils will be installed before its libglvnd dependency
warning: dependency cycle detected:
warning: egl-wayland will be installed before its mesa dependency
warning: dependency cycle detected:
warning: xorg-server will be installed before its libglvnd dependency
warning: dependency cycle detected:
warning: nvidia-utils will be installed before its mesa dependency
warning: dependency cycle detected:
warning: x264 will be installed before its ffmpeg dependency
warning: dependency cycle detected:
warning: lib32-harfbuzz will be installed before its lib32-freetype2 dependency
warning: dependency cycle detected:
warning: lib32-libglvnd will be installed before its lib32-mesa dependency
warning: dependency cycle detected:
warning: lib32-nvidia-utils will be installed before its lib32-libglvnd dependency
warning: dependency cycle detected:
warning: python-fixtures will be installed before its python-testtools dependency
warning: dependency cycle detected:
warning: rubygems will be installed before its ruby dependency
Packages (586)
...snip all my packages...
Total Installed Size: 5498.56 MiB
Net Upgrade Size: 106.28 MiB
:: Proceed with installation? [Y/n] y
(581/581) checking keys in keyring [#########################################] 100%
(581/581) checking package integrity [#########################################] 100%
(581/581) loading package files [#########################################] 100%
(581/581) checking for file conflicts [#########################################] 100%
error: failed to commit transaction (conflicting files)
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/__pycache__/debug.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/__pycache__/error.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/__pycache__/decoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/__pycache__/encoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/__pycache__/eoo.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/decoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/encoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/ber/eoo.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/cer/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/cer/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/cer/__pycache__/decoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/cer/__pycache__/encoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/cer/decoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/cer/encoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/der/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/der/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/der/__pycache__/decoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/der/__pycache__/encoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/der/decoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/der/encoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/native/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/native/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/native/__pycache__/decoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/native/__pycache__/encoder.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/native/decoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/codec/native/encoder.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/binary.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/calling.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/dateandtime.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/integer.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/octets.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/__pycache__/string.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/binary.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/calling.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/dateandtime.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/integer.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/octets.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/compat/string.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/debug.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/error.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__init__.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/base.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/char.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/constraint.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/error.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/namedtype.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/namedval.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/opentype.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/tag.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/tagmap.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/univ.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/__pycache__/useful.cpython-37.pyc exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/base.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/char.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/constraint.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/error.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/namedtype.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/namedval.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/opentype.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/tag.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/tagmap.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/univ.py exists in filesystem
python-pyasn1: /usr/lib/python3.7/site-packages/pyasn1/type/useful.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__init__.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/_common.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/_version.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/easter.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/relativedelta.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/rrule.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/tzwin.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/__pycache__/utils.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/_common.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/_version.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/easter.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/parser/__init__.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/parser/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/parser/__pycache__/_parser.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/parser/__pycache__/isoparser.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/parser/_parser.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/parser/isoparser.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/relativedelta.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/rrule.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/__init__.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/__pycache__/_common.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/__pycache__/_factories.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/__pycache__/tz.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/__pycache__/win.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/_common.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/_factories.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/tz.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tz/win.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/tzwin.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/utils.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/zoneinfo/__init__.py exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/zoneinfo/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/zoneinfo/__pycache__/rebuild.cpython-37.pyc exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz exists in filesystem
python-dateutil: /usr/lib/python3.7/site-packages/dateutil/zoneinfo/rebuild.py exists in filesystem
Errors occurred, no packages were upgraded.
我仍然可以愉快地安装单独的软件包。但操作系统更新被冻结,此时我的本地桌面上可能存在安全问题。在标准包更新过程中,如何处理如上所述的依赖循环和失败事务?
答案1
只要浏览一下 pacman 的输出,我就会看到很多“/bla/bla 存在于文件系统中”消息。这可能就是你的问题所在。我不知道这是怎么发生的,但 pacman 不喜欢覆盖文件,除非它确定您正在安装的软件包“拥有”所述文件。
我相信您可以使用该选项覆盖此检查--force
,尽管您应该这样做慎用,因为文件可能会被不兼容的版本覆盖。此外,每次遇到此类冲突时,您都必须这样做。这意味着你必须这样做每次您更新python-dateutil
或python-pyasn1
。
更永久的解决方案可能是在更新包之前删除这些文件。然而,这更加危险比最后一个解决方案更有效,因为它“可能”会破坏您的系统(取决于您被迫删除的文件)。如果您走这条路,请确保您对所有最重要的文件都有良好的备份,并确保保留实时 CD/DVD/闪存驱动器/任何方便的设备,以备您需要修复和/或重新安装系统时使用。
这是获取冲突文件列表的便捷方法:
while [ : ]; do echo y; done | sudo pacman -Syu | grep 'exists in filesystem$' | cut -f 2- -d ' ' | sed 's/ exists in filesystem$//g'
更新:我刚刚想起来,Arch 没有附带 sudo,因此您可能必须通过其他方式以 root 身份运行 pacman,例如将 sudo 命令替换为:su -c 'pacman -Syu'
。 (不知道 Manjaro 是否带有 sudo,但由于它是基于 Arch 的,我怀疑它没有。)
您可以使用上面的输出来制作冲突文件的备份副本(也许将它们放入 tarball 中)。该列表还可用于自动删除这些文件。这是一个很好的脚本,您可以使用它一次性备份和删除文件:
FILES="$(while [ : ]; do echo y; done | pacman -Syu | grep 'exists in filesystem$' | cut -f 2- -d ' ' | sed 's/ exists in filesystem$//g')"
echo "$FILES" | xargs -0 -d \\n -s 9999999999 tar -c -a -f /backup-broken-files.tar || exit
echo "$FILES" | xargs -0 -d \\n -s 9999999999 rm
echo "Backed up and removed conflicting application files."
我应该警告你:我曾经使用 Arch,直到最近我切换到 Fedora(主要是出于好奇)。也就是说,由于我不再拥有 Arch,我无法测试这个脚本,因此使用它的风险由您自行承担。另外,为了使该脚本正常工作,您(当然)需要运行它作为根用户。
如果您希望对要制作的 tarball 应用压缩,只需在文件名末尾添加适当的扩展名 - 例如 .xz、.gz 或 .bz2,tar 就会自动使用适当的压缩(感谢论据-a
)。
希望有人知道更安全的方法来解决这个问题(也许让 pacman 认为这些文件“已经”属于 Kzqai 试图安装/更新的软件包)。也许您应该在继续之前等待更好的答案。
PS:您可能会收到来自 xargs 的警告,提示“-s 选项的 x 值应该 <= y”,其中“x”和“y”是数字。不用担心,您可以安全地忽略此警告。