我已經安裝了 Manjaro linux,它是 Arch linux 的一個衍生版本,並且遇到了軟體更新循環依賴問題,建議的解決方法是什麼?
我在桌面上使用 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.
我仍然可以愉快地安裝單獨的軟體包。但是作業系統更新被凍結了,這在我的本地桌面上可能是一個安全問題。在標準包更新過程中,如何處理依賴循環和失敗的事務?
只需瀏覽一下 pacman 的輸出,我就會看到很多“/bla/bla 文件系統中存在”消息。那可能是你的問題。IDK 這可能是怎麼發生的,但是 pacman 不喜歡覆蓋文件,除非它確定你正在安裝的包“擁有”所說的文件。
我相信您可以使用該選項覆蓋此檢查
--force
,儘管您應該這樣做WITH CAUTION,因為文件可能會被不兼容的版本覆蓋。此外,每次遇到此類衝突時,您都必須這樣做。這意味著您每次更新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,IDK,但由於它是基於 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,我無法測試這個腳本,所以使用它需要您自擔風險。此外,要使此腳本正常工作,您(當然)需要將其作為 ROOT執行。
如果您希望對將要製作的 tarball 應用壓縮,只需在文件名末尾添加適當的副檔名 - 例如 .xz、.gz 或 .bz2,tar 將自動使用適當的壓縮(感謝
-a
論據)。希望有人會知道一種更安全的方法來解決這個問題(也許讓 pacman 認為這些文件已經由 Kzqai 嘗試安裝/更新的軟體包擁有)。也許您應該在繼續之前等待更好的答案。
PS:您可能會從 xargs 收到警告說“-s 選項的值 x 應該是 <= y”,其中“x”和“y”是數字。不用擔心,您可以放心地忽略此警告。