Aar*_*erl 5 upgrade dependencies python3
我最近安装了Python3.8,一切正常,在终端中成功使用了各种版本的Python。几天后,我打电话给sudo apt update,效果很好,但是当我这样做时,sudo apt upgrade我收到了下面的错误消息。我尝试这样做sudo apt --fix-broken install,但子进程返回了错误代码。
当我尝试sudo apt upgrade
输出时
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
dh-python : Depends: python3-distutils but it is not installed
python3-dev : Depends: python3-distutils (>= 3.6.7-1~) but it is not installed
python3-pip : Depends: python3-distutils 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).
Run Code Online (Sandbox Code Playgroud)
当我尝试sudo apt --fix-broken install
输出时
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libllvm7 libllvm8 libllvm8:i386 libpython3.7-minimal libpython3.7-stdlib
python3.7-minimal
Use 'sudo apt autoremove' to remove them.
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 122 not upgraded.
10 not fully installed or removed.
Need to get 0 B/222 kB of archives.
After this operation, 3,143 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 201984 files and directories currently installed.)
Preparing to unpack .../python3-lib2to3_3.6.9-1~18.04_all.deb ...
Unpacking python3-lib2to3 (3.6.9-1~18.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-lib2to3_3.6.9-1~18.04_all.deb (--unpack):
trying to overwrite '/usr/lib/python3.8/lib2to3/Grammar.txt', which is also in package python3.8-lib2to3 3.8.0-1+bionic2
Preparing to unpack .../python3-distutils_3.6.9-1~18.04_all.deb ...
Unpacking python3-distutils (3.6.9-1~18.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-distutils_3.6.9-1~18.04_all.deb (--unpack):
trying to overwrite '/usr/lib/python3.8/distutils/README', which is also in package python3.8-distutils 3.8.0-1+bionic2
Errors were encountered while processing:
/var/cache/apt/archives/python3-lib2to3_3.6.9-1~18.04_all.deb
/var/cache/apt/archives/python3-distutils_3.6.9-1~18.04_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)
我也尝试做这个sudo apt --fix-broken install python3-distutils
输出
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-distutils : Depends: python3-lib2to3 (>= 3.6.4) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).```
Run Code Online (Sandbox Code Playgroud)
我也尝试过sudo apt --fix-broken install python3-lib2to3
输出
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
dh-python : Depends: python3-distutils but it is not going to be installed
python3-dev : Depends: python3-distutils (>= 3.6.7-1~) but it is not going to be installed
python3-pip : Depends: python3-distutils 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).
Run Code Online (Sandbox Code Playgroud)
感谢您提供的任何帮助!
更新
当我尝试做的时候sudo apt install aptitude
输出
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
aptitude : Depends: aptitude-common (= 0.8.10-6ubuntu1) but it is not going to be installed
Depends: libcwidget3v5 but it is not going to be installed
dh-python : Depends: python3-distutils but it is not going to be installed
python3-dev : Depends: python3-distutils (>= 3.6.7-1~) but it is not going to be installed
python3-pip : Depends: python3-distutils 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).
Run Code Online (Sandbox Code Playgroud)
尝试使用以下内容代替:
sudo apt dist-upgrade
Run Code Online (Sandbox Code Playgroud)
由于 dist-upgrade 还处理新的包依赖项。
此处对此进行了解释: 为什么使用 apt-get Upgrade 而不是 apt-get dist-upgrade?
如果您想升级但无法升级,有多种方法可以解决此问题:
方式一
第 1 步:打开软件和更新。
第 2 步:更改Download from为主服务器
步骤3:打开终端( ctlr + alt + t) 然后sudo apt-get update,然后sudo apt-get upgrade
方法 2 删除 PPA
第 1 步:打开软件和更新。
第 2 步:转到“其他软件”选项卡,然后从列表中选择所需的 PPA。然后单击“删除”将其删除。
或者
您可以使用终端删除它:sudo apt-add-repository -r PPA_Name/ppa
方式3:
也尝试使用这个命令,可能有帮助:sudo apt clean,,sudo apt autoclean。sudo apt autoremove
希望对您有帮助!
| 归档时间: |
|
| 查看次数: |
29390 次 |
| 最近记录: |