我正在尝试更新Ubuntu并纠正一些系统设置,但是我遇到了一个问题,已经困扰我一个多星期了。
当我输入
所以我运行了
我尝试了几种方法,并在一些论坛上搜索错误,但是我找不到解决方案。这真的让我感到困惑。
我甚至尝试了删除:
任何帮助都将是很棒的!添加了以下内容
我跑了。
这是一个结果。
然后是以下内容:
还似乎不喜欢它
最新修复尝试之后
在执行了
当我输入
sudo apt-get install
时,我得到的结果是:The following packages have unmet dependencies.
python3.9 : Depends: libpython3.9-stdlib (= 3.9.5-3~20.04.1) but 3.9.5-1+bionic1 is installed
python3.9-minimal : Depends: libpython3.9-minimal (= 3.9.5-3~20.04.1) but 3.9.5-1+bionic1 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 additional packages will be installed:
libpython3.9-minimal libpython3.9-stdlib
The following packages will be upgraded:
libpython3.9-minimal libpython3.9-stdlib
2 to upgrade, 0 to newly install, 0 to remove and 33 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/2,532 kB of archives.
After this operation, 483 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 200853 files and directories currently installed.)
Preparing to unpack .../libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.5-3~20.04.1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py', which is also in package libpython3.
9-minimal:amd64 3.9.5-1+bionic1
Preparing to unpack .../libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.5-3~20.04.1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.9/typing.py', which is also in package libpython3.9-stdlib:amd64 3.9.5-1+bionic1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb
/var/cache/apt/archives/libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试了几种方法,并在一些论坛上搜索错误,但是我找不到解决方案。这真的让我感到困惑。
我甚至尝试了删除:
$ sudo apt remove libpython3.9-minimal/bionic libpython3.9-stdlib/bionic python3.9-minimal/focal-updates
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '3.9.5-1+bionic1' (New Python Versions:18.04/bionic [amd64]) for 'libpython3.9-minimal'
Selected version '3.9.5-1+bionic1' (New Python Versions:18.04/bionic [amd64]) for 'libpython3.9-stdlib'
Selected version '3.9.5-3~20.04.1' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'python3.9-minimal'
Selected version '3.9.5-3~20.04.1' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'libpython3.9-minimal' because of 'python3.9-minimal'
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
python3.9 : Depends: python3.9-minimal (= 3.9.5-3~20.04.1) but it is not going to be installed
Depends: libpython3.9-stdlib (= 3.9.5-3~20.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
任何帮助都将是很棒的!添加了以下内容
$ apt-cache policy python3.9 libpython3.9-stdlib libpython3.9-minimal python3.9-minimal
Installed: 3.9.5-3~20.04.1
Candidate: 3.9.5-3~20.04.1
Version table:
*** 3.9.5-3~20.04.1 500
500 ://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
500 ://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
100 /var/lib/dpkg/status
3.9.5-1+focal1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages
3.9.5-1+bionic1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages
libpython3.9-stdlib:
Installed: 3.9.5-1+bionic1
Candidate: 3.9.5-3~20.04.1
Version table:
3.9.5-3~20.04.1 500
500 ://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
500 ://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
3.9.5-1+focal1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages
*** 3.9.5-1+bionic1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
libpython3.9-minimal:
Installed: 3.9.5-1+bionic1
Candidate: 3.9.5-3~20.04.1
Version table:
3.9.5-3~20.04.1 500
500 ://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
500 ://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
3.9.5-1+focal1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages
*** 3.9.5-1+bionic1 500
500 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
libpython3.9-minimal:
Installed: 3.9.5-1+bionic1
Candidate: 3.9.5-3~20.04.1
Version table:
3.9.5-3~20.04.1 500
500 ://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
500 ://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
3.9.5-1+focal1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages
*** 3.9.5-1+bionic1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
python3.9-minimal:
Installed: 3.9.5-3~20.04.1
Candidate: 3.9.5-3~20.04.1
Version table:
*** 3.9.5-3~20.04.1 500
500 ://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
500 ://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
100 /var/lib/dpkg/status
3.9.5-1+focal1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages
3.9.5-1+bionic1 500
500 ://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages
我跑了。
~/Downloads$ sudo ppa-purge ppa:deadsnakes/ppa # first for bionic
这是一个结果。
sudo ppa-purge ppa:deadsnakes/ppa # first for bionic
Updating packages lists
PPA to be removed: deadsnakes ppa
Package revert list generated:
libpython3.8:amd64/focal libpython3.8-minimal:amd64/focal libpython3.8-stdlib:amd64/focal
libpython3.9-minimal:amd64/focal libpython3.9-stdlib:amd64/focal python3.8/focal python3.8-minimal/focal
然后是以下内容:
understudy@understudy-System-Product-Name:~/Downloads$ sudo ppa-purge ppa:deadsnakes/ppa # second for focal
Updating packages lists
PPA to be removed: deadsnakes ppa
Warning: Could not find package list for PPA: deadsnakes ppa
understudy@understudy-System-Product-Name:~/Downloads$ sudo ppa-purge ppa:deadsnakes/ppa # first for bionic
Updating packages lists
PPA to be removed: deadsnakes ppa
Warning: Could not find package list for PPA: deadsnakes ppa
understudy@understudy-System-Product-Name:~/Downloads$ sudo apt-get install python3.9=3.9.5-3~20.04.1 libpython3.9-stdlib=3.9.5-3~20.04.1 \
> libpython3.9-minimal=3.9.5-3~20.04.1 python3.9-minimal=3.9.5-3~20.04.1 --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libffi6 libncursesw5 libreadline7 libtinfo5
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
libpython3.9-minimal libpython3.9-stdlib
2 to upgrade, 0 to newly install, 2 reinstalled, 0 to remove and 36 not to upgrade.
7 not fully installed or removed.
Need to get 0 B/2,532 kB of archives.
After this operation, 483 kB of additional disk space will be used.
E: Internal Error, No file name for python3.9-minimal:amd64
还似乎不喜欢它
Disabling deadsnakes PPA from /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-focal.list
Disabling deadsnakes PPA from /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-bionic.list
Updating packages lists
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '3.8.5-1~20.04.3' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'libpython3.8'
Selected version '3.8.5-1~20.04.3' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'libpython3.8-minimal'
Selected version '3.8.5-1~20.04.3' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'libpython3.8-stdlib'
Selected version '3.9.5-3~20.04.1' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'libpython3.9-minimal'
Selected version '3.9.5-3~20.04.1' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'libpython3.9-stdlib'
Selected version '3.8.5-1~20.04.3' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'python3.8'
Selected version '3.8.5-1~20.04.3' (Ubuntu:20.04/focal-updates, Ubuntu:20.04/focal-security [amd64]) for 'python3.8-minimal'
The following packages were automatically installed and are no longer required:
libffi6 libncursesw5 libreadline7 libtinfo5
Use 'sudo apt autoremove' to remove them.
Suggested packages:
python3.8-venv python3.8-doc
The following packages will be upgraded:
libpython3.9-minimal libpython3.9-stdlib
The following packages will be DOWNGRADED:
libpython3.8 libpython3.8-minimal libpython3.8-stdlib python3.8 python3.8-minimal
2 to upgrade, 0 to newly install, 5 to downgrade, 0 to remove and 36 not to upgrade.
2 not fully installed or removed.
Need to get 6,280 kB/8,813 kB of archives.
After this operation, 1,083 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8 amd64 3.8.5-1~20.04.3 [1,624 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3.8 amd64 3.8.5-1~20.04.3 [373 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8-stdlib amd64 3.8.5-1~20.04.3 [1,671 kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3.8-minimal amd64 3.8.5-1~20.04.3 [1,897 kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8-minimal amd64 3.8.5-1~20.04.3 [715 kB]
Fetched 6,280 kB in 6s (969 kB/s)
(Reading database ... 200853 files and directories currently installed.)
Preparing to unpack .../0-libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.5-3~20.04.1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-vTH1pX/0-libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py', which is also in package libpython3.9-minimal:amd64 3.9.5-1+bionic1
Preparing to unpack .../1-libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.5-3~20.04.1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-vTH1pX/1-libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.9/typing.py', which is also in package libpython3.9-stdlib:amd64 3.9.5-1+bionic1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
dpkg: warning: downgrading libpython3.8:amd64 from 3.8.10-1+bionic1 to 3.8.5-1~20.04.3
Preparing to unpack .../2-libpython3.8_3.8.5-1~20.04.3_amd64.deb ...
Unpacking libpython3.8:amd64 (3.8.5-1~20.04.3) over (3.8.10-1+bionic1) ...
dpkg: warning: downgrading python3.8 from 3.8.10-1+bionic1 to 3.8.5-1~20.04.3
Preparing to unpack .../3-python3.8_3.8.5-1~20.04.3_amd64.deb ...
Unpacking python3.8 (3.8.5-1~20.04.3) over (3.8.10-1+bionic1) ...
dpkg: warning: downgrading libpython3.8-stdlib:amd64 from 3.8.10-1+bionic1 to 3.8.5-1~20.04.3
Preparing to unpack .../4-libpython3.8-stdlib_3.8.5-1~20.04.3_amd64.deb ...
Unpacking libpython3.8-stdlib:amd64 (3.8.5-1~20.04.3) over (3.8.10-1+bionic1) ...
dpkg: warning: downgrading python3.8-minimal from 3.8.10-1+bionic1 to 3.8.5-1~20.04.3
Preparing to unpack .../5-python3.8-minimal_3.8.5-1~20.04.3_amd64.deb ...
Unpacking python3.8-minimal (3.8.5-1~20.04.3) over (3.8.10-1+bionic1) ...
dpkg: warning: downgrading libpython3.8-minimal:amd64 from 3.8.10-1+bionic1 to 3.8.5-1~20.04.3
Preparing to unpack .../6-libpython3.8-minimal_3.8.5-1~20.04.3_amd64.deb ...
Unpacking libpython3.8-minimal:amd64 (3.8.5-1~20.04.3) over (3.8.10-1+bionic1) ...
Errors were encountered while processing:
/tmp/apt-dpkg-install-vTH1pX/0-libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb
/tmp/apt-dpkg-install-vTH1pX/1-libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
/usr/local/bin/ppa-purge: line 191: aptitude: command not found
Warning: Something went wrong, packages may not have been reverted
最新修复尝试之后
understudy@understudy-System-Product-Name:~$ # sudo apt-get install ppa-purge
understudy@understudy-System-Product-Name:~$ cd ~/Downloads
understudy@understudy-System-Product-Name:~/Downloads$ sudo apt-get download ppa-purge
[sudo] password for understudy:
understudy@understudy-System-Product-Name:~/Downloads$ dpkg -x ppa-purge_0.2.8+bzr63_all.deb ppap
understudy@understudy-System-Product-Name:~/Downloads$ sudo cp ppap/usr/sbin/ppa-purge /usr/local/bin/
understudy@understudy-System-Product-Name:~/Downloads$ sudo ppa-purge ppa:deadsnakes/ppa # first for bionic
Updating packages lists
PPA to be removed: deadsnakes ppa
Warning: Could not find package list for PPA: deadsnakes ppa
understudy@understudy-System-Product-Name:~/Downloads$ sudo ppa-purge ppa:deadsnakes/ppa # second for focal
Updating packages lists
PPA to be removed: deadsnakes ppa
Warning: Could not find package list for PPA: deadsnakes ppa
understudy@understudy-System-Product-Name:~/Downloads$ sudo apt-get install python3.9=3.9.5-3~20.04.1 libpython3.9-stdlib=3.9.5-3~20.04.1 \
> libpython3.9-minimal=3.9.5-3~20.04.1 python3.9-minimal=3.9.5-3~20.04.1 --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libffi6 libncursesw5 libreadline7 libtinfo5
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
libpython3.9-minimal libpython3.9-stdlib
2 to upgrade, 0 to newly install, 2 reinstalled, 0 to remove and 36 not to upgrade.
7 not fully installed or removed.
Need to get 0 B/2,532 kB of archives.
After this operation, 483 kB of additional disk space will be used.
E: Internal Error, No file name for python3.9-minimal:amd64
understudy@understudy-System-Product-Name:~/Downloads$ sudo apt-get 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.12-1ubuntu4) but it is not going to be installed
Depends: libcwidget4 (>= 0.5.18-1) but it is not going to be installed
Recommends: libparse-debianchangelog-perl but it is not going to be installed
python3.9 : Depends: libpython3.9-stdlib (= 3.9.5-3~20.04.1) but 3.9.5-1+bionic1 is to be installed
python3.9-minimal : Depends: libpython3.9-minimal (= 3.9.5-3~20.04.1) but 3.9.5-1+bionic1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
在执行了
sudo apt --fix-broken install
命令之后[sudo] password for understudy:
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:
libffi6 libncursesw5 libreadline7 libtinfo5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libpython3.9-minimal libpython3.9-stdlib
The following packages will be upgraded:
libpython3.9-minimal libpython3.9-stdlib
2 to upgrade, 0 to newly install, 0 to remove and 36 not to upgrade.
7 not fully installed or removed.
Need to get 0 B/2,532 kB of archives.
After this operation, 483 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 200857 files and directories currently installed.)
Preparing to unpack .../libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.5-3~20.04.1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py', which is also in package libpython3.9-minimal:amd64 3.9.5-1+bionic1
Preparing to unpack .../libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.5-3~20.04.1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.9/typing.py', which is also in package libpython3.9-stdlib:amd64 3.9.5-1+bionic1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb
/var/cache/apt/archives/libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
apt-cache policy python3.9 libpython3.9-stdlib libpython3.9-minimal python3.9-minimal
的输出结果。 - N0rbertsudo apt-get install aptitude
命令安装Aptitude。 - N0rbertgrep "^deb\ " -r /etc/apt/ --include=*.list
和 Python 源码apt-cache policy python3.9 libpython3.9-stdlib libpython3.9-minimal python3.9-minimal
- 将输出添加到问题中。如果内容较长,请使用 Pastebin。 - N0rbertsudo apt --fix-broken install
解决了它。 - LeonardoAyala