software-properties-gtk falha na inicialização do Ubuntu 16.04

2

Demora cerca de dois dias que o Atualizador de Software não me alerta para atualizações. Esta manhã eu descobri que software-properties-gtk falha repetidamente na inicialização do sistema e se eu tentar iniciá-lo pelo terminal, ele acaba com o seguinte traceback:

Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 54, in <module>
    from UbuntuDrivers import detect
  File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 21, in <module>
    system_architecture = apt.apt_pkg.get_architectures()[0]
AttributeError: module 'apt' has no attribute 'apt_pkg'

Comportamento semelhante para o update-manager :

Traceback (most recent call last):
  File "/usr/bin/update-manager", line 38, in <module>
    from UpdateManager.UpdateManager import UpdateManager
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 58, in <module>
    from .UpdatesAvailable import UpdatesAvailable
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdatesAvailable.py", line 61, in <module>
    from DistUpgrade.DistUpgradeCache import NotEnoughFreeSpaceError
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeCache.py", line 109, in <module>
    class MyCache(apt.Cache):
AttributeError: module 'apt' has no attribute 'Cache'

Portanto, o problema parece estar relacionado aos módulos python apt . No entanto, com Python 2.7.12 ou Python 3.5.2 iniciado a partir do terminal, posso executar esses comandos sem nenhum problema, por exemplo:

>>> import apt
>>> apt.apt_pkg.get_architectures()[0]
'amd64'

Eu também tentei reinstalar vários pacotes de linux relacionados a apt / python junto com software-properties-gtk e update-manager . No entanto, sem sorte.

A lista de (talvez) todos os pacotes que eu reinstalei:

apt apt-utils aptdaemon aptdaemon-data update-manager update-manager-core software-properties-gtk dbus python-pkg-resources python3-pkg-resources python-apt python3-apt python-aptdaemon python3-aptdaemon python-apt-common python-aptdaemon.gtk3widgets python3-aptdaemon.gtk3widgets python3-aptdaemon.pkcompat libapt-inst2.0 libapt-pkg5.0

Felizmente o problema afeta apenas as interfaces gráficas, ie eu posso atualizar, instalar ou remover pacotes do ubuntu do terminal através de apt , apt-get , aptitude , ... Enfim, é um pouco chato.

Atualização: Eu também tentei (sem sorte) reinstalar todos os pacotes python3 instalados anteriormente:

sudo apt-get install --reinstall libpeas-1.0-0-python3loader libpython3-stdlib libpython3.5 libpython3.5-minimal libpython3.5-stdlib python3 python3-apport python3-apt python3-aptdaemon python3-aptdaemon.gtk3widgets python3-aptdaemon.pkcompat python3-blinker python3-brlapi python3-bs4 python3-cairo python3-catkin-pkg-modules python3-cffi-backend python3-chardet python3-checkbox-support python3-commandnotfound python3-cryptography python3-cups python3-cupshelpers python3-dateutil python3-dbus python3-dbus.mainloop.qt python3-debian python3-defer python3-distupgrade python3-docutils python3-empy python3-ewmh python3-feedparser python3-gdbm python3-gi python3-gi-cairo python3-guacamole python3-html5lib python3-httplib2 python3-idna python3-jinja2 python3-jwt python3-louis python3-lxml python3-mako python3-markupsafe python3-minimal python3-oauthlib python3-padme python3-pexpect python3-pil python3-pkg-resources python3-plainbox python3-problem-report python3-progressbar python3-ptyprocess python3-pyasn1 python3-pyatspi python3-pycurl python3-pygments python3-pyparsing python3-renderpm python3-reportlab python3-reportlab-accel python3-requests python3-roman python3-ros-buildfarm python3-ros-buildfarm-modules python3-rosdistro-modules python3-rospkg-modules python3-setuptools python3-six python3-software-properties python3-speechd python3-systemd python3-uno python3-update-manager python3-urllib3 python3-xdg python3-xkit python3-xlib python3-xlsxwriter python3-yaml python3.5 python3.5-minimal
    
por alextoind 22.06.2017 / 12:38

1 resposta

2

Eu tive o mesmo problema. Estava relacionado à instalação do pacote ROS python3-ros-buildfarm para testes de pré-lançamento. Ele instala um arquivo /usr/bin/apt.py , que eu presumo está causando este conflito de nomes. Remover este pacote resolveu o problema para mim.

    
por Christian Rauch 27.06.2017 / 03:21