When I run sudo apt update
I get the following error:
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
I believe the problem might be connected to Python. After running sudo apt-get install -f
, the following messages appear:
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)
As I'm quite new to Linux, can anyone help me out with fixing this problem?
After running sudo apt install --reinstall python3-minimal
the problem seems to have disappeared and everything seems to be working fine now (even Terminal is back). In any case, here is the result of python -v: Python 2.7.15+
python -V
command. – Pilot6 Oct 01 '19 at 17:13