【BUG】Python3|安装python3-pip依赖缺失,might want to run ‘apt --fix-broken install‘ to correct these. unment
python3-pip is already the newest version (20.0.2-5ubuntu1.7).You might want to run 'apt --fix-broken install' to correct these.The following packages have unmet dependencies:python3-pip : Depends: py
·
省流版
今天装python,版本装错了。
然后删又删不掉,装pip又装不上,报错是这样的:
想装的时候:
7f2a0f717aa3:~/$ sudo apt-get install python3-pip python3-setuptools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-setuptools is already the newest version (45.2.0-1ubuntu0.1).
python3-setuptools set to manually installed.
python3-pip is already the newest version (20.0.2-5ubuntu1.7).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-pip : Depends: python3-distutils but it is not going to be installed
Recommends: build-essential but it is not going to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
python3-setuptools : Depends: python3-distutils but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
想删掉的时候:
7f2a0f717aa3:~/$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-pip : Depends: python3-distutils but it is not installed
Recommends: build-essential but it is not installed
Recommends: python3-dev (>= 3.2) but it is not installed
python3-setuptools : Depends: python3-distutils but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
想按照提示apt --fix-broken install
的时候,一直这样:
7f2a0f717aa3:~/$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
python3-distutils python3-lib2to3
The following NEW packages will be installed:
python3-distutils python3-lib2to3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
7 not fully installed or removed.
Need to get 218 kB of archives.
After this operation, 2115 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
New Bing告诉我可以这样解决,如下:
有一些可能的解决方案是:
- 运行apt --fix-broken install命令来修复损坏的依赖关系。
- 运行apt-get update和apt-get upgrade命令来更新软件包列表和安装最新版本的软件包。
- 运行apt-get install -f命令来尝试自动修复依赖关系问题。
- 运行dpkg --configure -a命令来配置所有未配置的软件包。
前面三种对我没用,我试过很多次了还是一直报错,导致其他包也装不上。于是用了第四种,然后继续报错:
7f2a0f717aa3:~/$ sudo dpkg --configure -a
dpkg: error: requested operation requires superuser privilege
shandian@7f2a0f717aa3:~/fuzzware$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of python3-setuptools:
python3-setuptools depends on python3-distutils; however:
Package python3-distutils is not installed.
dpkg: error processing package python3-setuptools (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-pip:
python3-pip depends on python3-distutils; however:
Package python3-distutils is not installed.
python3-pip depends on python3-setuptools; however:
Package python3-setuptools is not configured yet.
dpkg: error processing package python3-pip (--configure):
dependency problems - leaving unconfigured
Setting up python-pip-whl (20.0.2-5ubuntu1.7) ...
Setting up libpython3-stdlib:amd64 (3.8.2-0ubuntu2) ...
Setting up python3 (3.8.2-0ubuntu2) ...
running python rtupdate hooks for python3.8...
running python post-rtupdate hooks for python3.8...
Setting up python3-wheel (0.34.2-1ubuntu0.1) ...
Setting up python3-pkg-resources (45.2.0-1ubuntu0.1) ...
Errors were encountered while processing:
python3-setuptools
python3-pip
NewBing说:
根据网上的信息,您可能遇到了dpkg处理python3-pip软件包时的错误。
有一些可能的解决方案是:
- 运行sudo dpkg --remove --force-remove-reinstreq python3-pip python3-setuptools python3-wheel命令来强制删除有问题的软件包。
- 运行sudo apt-get install python3-pip python3-setuptools python3-wheel命令来重新安装这些软件包。
- 运行sudo apt-get -f install命令来尝试自动修复依赖关系问题。
第一种方式work for me。
7f2a0f717aa3:~/$ sudo dpkg --remove --force-remove-reinstreq python3-pip python3-setuptools python3-wheel
(Reading database ... 19413 files and directories currently installed.)
Removing python3-pip (20.0.2-5ubuntu1.7) ...
Removing python3-setuptools (45.2.0-1ubuntu0.1) ...
Removing python3-wheel (0.34.2-1ubuntu0.1) ...
感谢NewBing。
解决方案来源于:How to fix unmet dependencies after removing python?_Ubuntu问答社区。
详细解释版
TODO
本账号所有文章均为原创,欢迎转载,请注明文章出处:https://blog.csdn.net/qq_46106285/article/details/129094234
。百度和各类采集站皆不可信,搜索请谨慎鉴别。技术类文章一般都有时效性,本人习惯不定期对自己的博文进行修正和更新,因此请访问出处以查看本文的最新版本。
更多推荐
已为社区贡献1条内容
所有评论(0)