简体   繁体   English

Ubuntu20.04无法卸载python3.7

[英]Unable to uninstall python3.7 in Ubuntu20.04

my problem is that i did a standard update through ubuntus update programm.我的问题是我通过 ubuntus 更新程序进行了标准更新。 Now everytime I try to use apt for anything, it throws the following error:现在每次我尝试将 apt 用于任何事情时,都会引发以下错误:

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:
 libpython3.7-stdlib : Depends: libpython3.7-minimal (= 3.7.12-1+focal1) but 3.7.13-1+focal3 is installed
 python3.7 : Depends: libpython3.7-stdlib (= 3.7.13-1+focal3) but 3.7.12-1+focal1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I so far tried:到目前为止,我尝试过:

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:
  python3.7-distutils python3.7-lib2to3
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpython3.7-stdlib
The following packages will be upgraded:
  libpython3.7-stdlib
1 upgraded, 0 newly installed, 0 to remove and 363 not upgraded.
1 not fully installed or removed.
Need to get 1.773 kB of archives.
After this operation, 90,1 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 libpython3.7-stdlib amd64 3.7.13-1+focal3 [1.773 kB]
Fetched 1.773 kB in 0s (4.827 kB/s)           
(Reading database ... 329479 files and directories currently installed.)
Preparing to unpack .../libpython3.7-stdlib_3.7.13-1+focal3_amd64.deb ...
Unpacking libpython3.7-stdlib:amd64 (3.7.13-1+focal3) over (3.7.12-1+focal1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.7-stdlib_3.7.1
3-1+focal3_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.7/distutils/__init__.py', which is also i
n package python3.7-distutils 3.7.12-1+focal1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libpython3.7-stdlib_3.7.13-1+focal3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get autoremove --purge python3.7

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:
 libpython3.7-stdlib : Depends: libpython3.7-minimal (= 3.7.12-1+focal1) but 3.7.13-1+focal3 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

and bascially every other version of apt remove, but to no prevail.并且基本上所有其他版本的 apt remove ,但没​​有占上风。

Thank you guys in advance!提前谢谢你们!

I ran into the same issue today and for me this worked:我今天遇到了同样的问题,对我来说很有效:

In our case it is:在我们的例子中是:

sudo dpkg -P python3.7
sudo dpkg -P libpython3.7-stdlib

No guarantees on this being safe or anything, it just seems to have worked for me.不能保证这是安全的或任何东西,它似乎对我有用。

Hope it helps you and others having this problem.希望它可以帮助您和其他遇到此问题的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM