python - Ubuntu20.04无法卸载python3.7

标签 python linux ubuntu

我的问题是我通过 ubuntus 更新程序进行了标准更新。
现在每次我尝试将 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).
到目前为止,我尝试过:
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).
并且基本上所有其他版本的 apt remove ,但没​​有占上风。
提前谢谢你们!

最佳答案

我今天遇到了同样的问题,对我来说 this工作:
在我们的例子中是:

sudo dpkg -P python3.7
sudo dpkg -P libpython3.7-stdlib
不能保证这是安全的或任何东西,它似乎对我有用。
希望它可以帮助您和其他遇到此问题的人。

关于python - Ubuntu20.04无法卸载python3.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72183477/

相关文章:

jquery - 为什么没有 "compound method call statement",即 ".="?

python - 尝试在 DF 的切片副本上设置值

python - 用于解析文件 block 的正则表达式

找不到 Maven 3.0.4 安装到 Ubuntu mvn

angularjs - 如何正确安装 Start Angular 模板?

Python SocketIO KeyError : 'Session is disconnected'

c - 隐式调用时如何使用RTLD_DEEPBIND?

linux - 在 Linux 终端中运行 ffmpeg

linux - 具有 GPU 支持但不支持窗口的离屏渲染

sql-server - 在 Ubuntu 上通过 TSQL 连接到 MSSQL 时遇到问题