yay -Syu
如果我嘗試使用或更新我的軟體包,我會收到錯誤sudo pacman -Syu
(270/270) checking for file conflicts [############################################################################] 100%
error: failed to commit transaction (conflicting files)
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/__pycache__/wheel_builder.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/cli/__pycache__/main.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/cli/main.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/distributions/sdist.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/index/__init__.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/index/__pycache__/__init__.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/index/__pycache__/collector.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/index/__pycache__/package_finder.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/index/collector.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/index/package_finder.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/models/__pycache__/scheme.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/models/__pycache__/wheel.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/models/scheme.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/models/wheel.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/network/__pycache__/download.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/network/__pycache__/utils.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/network/download.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/network/utils.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/__init__.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/__pycache__/__init__.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/__pycache__/metadata.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/__pycache__/metadata_legacy.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/__pycache__/wheel.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/__pycache__/wheel_legacy.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/metadata.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/metadata_legacy.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/wheel.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/build/wheel_legacy.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/__init__.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/__pycache__/__init__.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/__pycache__/editable_legacy.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/__pycache__/legacy.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/__pycache__/wheel.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/editable_legacy.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/legacy.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/__pycache__/distutils_args.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/__pycache__/entrypoints.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/__pycache__/pkg_resources.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/__pycache__/wheel.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/distutils_args.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/entrypoints.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/pkg_resources.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/wheel.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/wheel_builder.py exists in filesystem
Errors occurred, no packages were upgraded.
我還嘗試覆蓋選項,因為許多來源都推薦它:
sudo pacman -S python-pip --overwrite /usr/lib/python3.8/site-packages/pip/_internal/*
甚至有:
sudo pacman -S python-pip --overwrite *
但隨後我收到以下錯誤訊息:
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/cache.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/cache.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/cli
warning: '/usr/lib/python3.8/site-packages/pip/_internal/cli' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/commands
warning: '/usr/lib/python3.8/site-packages/pip/_internal/commands' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/configuration.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/configuration.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/distributions
warning: '/usr/lib/python3.8/site-packages/pip/_internal/distributions' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/exceptions.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/exceptions.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/index
warning: '/usr/lib/python3.8/site-packages/pip/_internal/index' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/__init__.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/__init__.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/locations.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/locations.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/main.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/main.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/models
warning: '/usr/lib/python3.8/site-packages/pip/_internal/models' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/network
warning: '/usr/lib/python3.8/site-packages/pip/_internal/network' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/operations
warning: '/usr/lib/python3.8/site-packages/pip/_internal/operations' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/pep425tags.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/pep425tags.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/__pycache__
warning: '/usr/lib/python3.8/site-packages/pip/_internal/__pycache__' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/pyproject.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/pyproject.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/req
warning: '/usr/lib/python3.8/site-packages/pip/_internal/req' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/utils
warning: '/usr/lib/python3.8/site-packages/pip/_internal/utils' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/vcs
warning: '/usr/lib/python3.8/site-packages/pip/_internal/vcs' is a file, did you mean -U/--upgrade instead of -S/--sync?
error: target not found: /usr/lib/python3.8/site-packages/pip/_internal/wheel_builder.py
warning: '/usr/lib/python3.8/site-packages/pip/_internal/wheel_builder.py' is a file, did you mean -U/--upgrade instead of -S/--sync?
有人可以跟我解釋一下如何解決這個問題嗎?我唯一知道的是,我曾經啟動過一次更新,但由於我的筆記型電腦電池電量不足而被突然取消。
答案1
在我發現的所有來源中,覆蓋命令都是錯誤的。你必須這樣寫:
sudo pacman -S python-pip --overwrite='/usr/lib/python3.8/site-packages/*'
請注意引號和等號!
在這一點上,我要感謝 Manjaro IRC Chanel 的 SysGhost,他向我展示了問題的解決方案。