Когда я запускаю sudo apt update
, я получаю следующую ошибку:
sh: 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
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
Я полагаю, что проблема может быть связана с Python. После запуска sudo apt-get install -f
появляются следующие сообщения:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 19 not to upgrade.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-wheel (0.30.0-0.2) ...
/var/lib/dpkg/info/python3-wheel.postinst: 6: /var/lib/dpkg/info/python3-wheel.postinst: py3compile: not found
dpkg: error processing package python3-wheel (--configure):
installed python3-wheel package post-installation script subprocess returned error exit status 127
Setting up python3-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
/var/lib/dpkg/info/python3-pip.postinst: 6: /var/lib/dpkg/info/python3-pip.postinst: py3compile: not found
dpkg: error processing package python3-pip (--configure):
installed python3-pip package post-installation script subprocess returned error exit status 127
Setting up python3-setuptools (39.0.1-2) ...
/var/lib/dpkg/info/python3-setuptools.postinst: 6: /var/lib/dpkg/info/python3-setuptools.postinst: py3compile: not found
dpkg: error processing package python3-setuptools (--configure):
installed python3-setuptools package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python3-wheel
python3-pip
python3-setuptools
E: Sub-process /usr/bin/dpkg returned an error code (1)
После запуска sudo apt install --reinstall python3-minimal
проблема, кажется, исчезла, и теперь все работает нормально (даже терминал вернулся). В любом случае, вот результат python -v: Python 2.7.15+
Этот точный вопрос с той же ошибкой задали год назад. Решение состоит в том, чтобы создать символьную ссылку на Python для устранения проблемы:
Так проверяют, где ссылка/usr/bin/python указывает:
$ ls -la /usr/bin/python
lrwxrwxrwx 1 root root 9 Jan 24 2017 /usr/bin/python -> python2.7
It should point to python2, not to any python3 executable. If it points to python3 then do the following (man ln):
$ sudo rm -f /usr/bin/python
$ sudo ln -s /usr/bin/python2.7 /usr/bin/python
После этого, apt-get/apt начнет работать снова.
Ошибка при попытке sudo склонный - получают обновление - связанный Python? Ошибка на шоу сообщения:
sh 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Succes 'if /usr/bin/test -w /var/lib/command-not-found -a -e /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code