Ошибка синтаксиса при настройке python3-aptdaemon

[Авг, 11: 21.20] Привет всем. во время устранения неполадок я создал новую проблему. см. ссылку ниже

Как переустановить пакет APT

Результат переустановки:

$ sudo apt install --reinstall python3-aptdaemon
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for python3-aptdaemon:amd64
ariel@ariel:~$ sudo apt install --reinstall python3-aptdaemon
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for python3-aptdaemon:amd64

еще один результат о pkg: для обновления .

$ sudo apt-get update

Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                           
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                         
Hit:4 http://ppa.launchpad.net/diesch/testing/ubuntu bionic InRelease                                  
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                            
Ign:6 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu bionic InRelease              
Err:7 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu bionic Release                 
  404  Not Found [IP: 91.189.95.83 80]
Traceback (most recent call last):                                                   
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code 

обновлен вывод решения:

$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in auto mode
ariel@ariel:/etc/apt/sources.list.d

$ sudo update-alternatives --config python3

There is only one alternative in link group python3 (providing /usr/bin/python3): /usr/bin/python3.6
Nothing to configure.
ariel@ariel:/etc/apt/sources.list.d$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-aptdaemon (1.1.1+bzr982-0ubuntu19.1) ...
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1570
    async = reply_handler and error_handler
          ^
SyntaxError: invalid syntax

dpkg: error processing package python3-aptdaemon (--configure):
 installed python3-aptdaemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of python3-aptdaemon.gtk3widgets:
 python3-aptdaemon.gtk3widgets depends on python3-aptdaemon (= 1.1.1+bzr982-0ubuntu19.1); however:
  Package python3-aptdaemon is not configured yet.

dpkg: error processing package python3-aptdaemon.gtk3widgets (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of language-selector-gnome:
 language-selector-gnome depends on python3-aptdaemon.gtk3widgets; however:
  Package python3-aptdaemon.gtk3widgets is not configured yet.

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: error processing package language-selector-gnome (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on language-selector-gnome; however:
  Package language-selector-gnome is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 python3-aptdaemon
 python3-aptdaemon.gtk3widgets
 language-selector-gnome
 ubuntu-desktop
E: Sub-process /usr/bin/dpkg returned an error code (1)
ariel@ariel:/etc/apt/sources.list.d$ 

Всякий раз, когда я пытаюсь установить какое-либо программное обеспечение, оно выдает мне следующую ошибку. Я пытался sudo apt-get install -f, но он выводит

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-aptdaemon (1.1.1+bzr982-0ubuntu19.1) ...
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1570
    async = reply_handler and error_handler
          ^
SyntaxError: invalid syntax

dpkg: error processing package python3-aptdaemon (--configure):
 installed python3-aptdaemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of python3-aptdaemon.gtk3widgets:
 python3-aptdaemon.gtk3widgets depends on python3-aptdaemon (= 1.1.1+bzr982-0ubuntu19.1); however:
  Package python3-aptdaemon is not configured yet.

dpkg: error processing package python3-aptdaemon.gtk3widgets (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          dpkg: dependency problems prevent configuration of language-selector-gnome:
 language-selector-gnome depends on python3-aptdaemon.gtk3widgets; however:
  Package python3-aptdaemon.gtk3widgets is not configured yet.

dpkg: error processing package language-selector-gnome (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on language-selector-gnome; however:
  Package language-selector-gnome is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 python3-aptdaemon
 python3-aptdaemon.gtk3widgets
 language-selector-gnome
 ubuntu-desktop
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ sudo apt clean && sudo apt autoclean && sudo apt remove && sudo apt autoremove -y && sudo apt install -f && sudo dpkg --configure -a && sudo apt update && sudo apt full-upgrade

[sudo] password for ariel: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-aptdaemon (1.1.1+bzr982-0ubuntu19.1) ...
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1570
    async = reply_handler and error_handler
          ^
SyntaxError: invalid syntax

dpkg: error processing package python3-aptdaemon (--configure):
 installed python3-aptdaemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of python3-aptdaemon.gtk3widgets:
 python3-aptdaemon.gtk3widgets depends on python3-aptdaemon (= 1.1.1+bzr982-0ubuntu19.1); however:
  Package python3-aptdaemon is not configured yet.

dpkg: error processing package python3-aptdaemon.gtk3widgets (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of language-selector-gnome:
 language-selector-gnome depends on python3-aptdaemon.gtk3widgets; however:
  Package python3-aptdaemon.gtk3widgets is not configured yet.

dpkg: error processing package language-selector-gnome (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on language-selector-gnome; however:
  Package language-selector-gnome is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leavinNo apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                                       No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                   No apport report written because MaxReports is reached already
                   g unconfigured
Errors were encountered while processing:
 python3-aptdaemon
 python3-aptdaemon.gtk3widgets
 language-selector-gnome
 ubuntu-desktop
E: Sub-process /usr/bin/dpkg returned an error code (1)

>

0
задан 11 August 2019 в 18:50

3 ответа

Это из-за несовместимости версии Python 3. Вы установили версию 3.7.3 Python и сделали ее значением по умолчанию. Версия по умолчанию Python 3 в 18.04 Бионических Бобрах 3.6.8. Необходимо переключиться назад на версию 3.6.8. Для этого выполненный

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --config python3

и войдите 1.

Связанные отчеты об ошибках:

2
ответ дан 23 October 2019 в 08:09

У меня сработала следующая команда:

sudo apt-get remove python3-apt
sudo apt-get install python3-apt
sudo apt remove python3-aptdaemon
sudo apt install python3-aptdaemon
1
ответ дан 9 December 2019 в 09:48

Сегодня я столкнулся с этой проблемой. Похоже, что async был добавлен как функциональный символ между 3.6.8 и 3.6.9 (что нелепо - такая вещь не должна меняться между уровнями патча).
Мне пришлось отредактировать /usr/lib/python3/dist-packages/aptdaemon/client.py и заменить каждое вхождение «async» другим именем переменной (я просто добавил символ). После этого моя система снова смогла установить все отсутствующие пакеты.

Итак, настоящим виновником, похоже, является изменение в Python3, которое выходит за рамки изменения версии.

2
ответ дан 7 February 2020 в 10:31

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

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