Неудовлетворенные зависимости python3.9

Я пытаюсь обновить 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).

Любая помощь была бы замечательной!

Добавлено следующее: g

$ 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)
7
задан 2 June 2021 в 15:39

2 ответа

Эта статья помогла мне код ошибки dpkg 1

sudo dpkg --configure -a
sudo apt remove --purge python3.9-minimal python3.9
sudo apt autoremove
sudo apt upgrade
1
ответ дан 28 July 2021 в 11:33

Вы добавили ненужный репозиторий PPA. Чтобы удалить его, используйте команды ниже:

# sudo apt-get install ppa-purge
cd ~/Downloads
apt-get download ppa-purge
dpkg -x ppa-purge_0.2.8+bzr63_all.deb ppap
sudo cp ppap/usr/sbin/ppa-purge /usr/local/bin/

sudo ppa-purge ppa:deadsnakes/ppa # first for bionic
sudo ppa-purge ppa:deadsnakes/ppa # second for focal

, а затем переустановите обычные версии Python из официальных репозиториев 20.04 LTS:

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

Затем установите Aptitude с помощью

sudo apt-get install aptitude

и возобновите установку пакета с помощью

sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted

sudo apt-get update
sudo apt-get install -f
sudo dpkg -i --force-all /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

sudo dpkg --configure -a
sudo aptitude 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
sudo aptitude dist-upgrade
3
ответ дан 28 July 2021 в 11:33

Другие вопросы по тегам:

Похожие вопросы: