简体   繁体   中英

Unable to uninstall python3.7 in Ubuntu20.04

my problem is that i did a standard update through ubuntus update programm. Now everytime I try to use apt for anything, it throws the following error:

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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