我的问题是我通过ubuntu更新程序做了一个标准的更新。现在,每次我尝试使用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 try:
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,但没有流行。
提前感谢大家!
我今天遇到了同样的问题,对我来说这是有效的:
在我们的例子中是:
sudo dpkg -P python3.7
sudo dpkg -P libpython3.7-stdlib
不能保证这是安全的,它似乎对我有用。
希望它能帮助你和其他有这个问题的人。