Связанные с Python ошибки при выполнении способного обновления после добавления и удаления репозитория Бодхи

Ошибка при выполнении обновления:

thufir@bot:~$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:2 http://ca.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://ca.archive.ubuntu.com/ubuntu bionic-updates InRelease [83.2 kB]        
Hit:4 http://ca.archive.ubuntu.com/ubuntu bionic-backports InRelease 
Fetched 166 kB in 1s (138 kB/s)
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
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7_ version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
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
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7_ version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

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
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7_ version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
Reading package lists... Done
W: Problem unlinking the file auxfiles - Clean (21: Is a directory)
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
thufir@bot:~$ 

Существует возможность, эта ошибка была представлена путем попытки добавить repos для бодхи. sources.list файл:

thufir@bot:~$ cat /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic universe
deb http://ca.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ca.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://ca.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

#deb [trusted=yes] http://packages.bodhilinux.com/bodhi xenial b4main
thufir@bot:~$ 

Отметьте это bodhi, последняя строка, комментируется. ОС:

thufir@bot:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04 LTS
Release:    18.04
Codename:   bionic

Способная версия:

thufir@bot:~$ apt-cache policy apt
apt:
  Installed: 2.2.12~bodhi2
  Candidate: 2.2.12~bodhi2
  Version table:
 *** 2.2.12~bodhi2 100
        100 /var/lib/dpkg/status
     1.6.1 500
        500 http://ca.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

Возможно, проблемой является неудавшееся обновление?

0
задан 28 May 2018 в 05:41

1 ответ

Похоже на установку некоторой сторонней версии apt пакет, но сохраненный сопровождением и по-видимому несовместимый libapt-pkg5.0 пакет, как это было из репозиториев Canonical.

Обычно можно вызвать пакеты к их новой версии, доступной для текущего релиза Ubuntu с:

sudo apt install {PACKAGE_NAME,...}/$(lsb_release -sc)

Однако в этой Кв. случая самой затронут и поврежден так, Вы должны:

  1. Загрузите пакеты вручную с хранилища пакетов (apt, libapt-pkg5.0).

    1. Удостоверьтесь, что страница пакета для Вашего релиза Ubuntu (взгляд около вершины),
    2. Прокрутите к разделу загрузки у основания страницы каждого пакета,
    3. нажмите на ссылку для своей архитектуры,
    4. выберите подходящее зеркало загрузки и
    5. храните файлы пакета в месте, которое можно помнить за следующий шаг, например. /tmp.
  2. Установите загруженные пакеты Deb с dpkg:

    cd /tmp
    sudo dpkg -i {apt,libapt-pkg5.0}_*.deb
    
  3. Обновите свои пакеты, чтобы проверить, что Кв. работает, и удостоверьтесь, что у Вас есть новая версия:

    sudo apt update
    sudo apt upgrade
    
2
ответ дан 29 October 2019 в 06:13

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

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