I tried everything,I still have the error
sudo apt update
shows
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 tried back and fort Pyhton2,3. Now
python --version
Python 2.7.18
python3 --version
bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 18 Mar 2 09:37 /usr/bin/python -> /usr/bin/python2.7
lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3662032 Jul 1 2022 /usr/bin/python2.7
-rwxr-xr-x 1 root root 5494584 Nov 14 13:59 /usr/bin/python3.8
lrwxrwxrwx 1 root root 33 Nov 14 13:59 /usr/bin/python3.8-config -> x86_64-linux-gnu-python3.8-config
-rwxr-xr-x 1 root root 5762192 Dec 7 02:11 /usr/bin/python3.9
lrwxrwxrwx 1 root root 16 Mar 13 2020 /usr/bin/python3-config -> python3.8-config
-rwxr-xr-x 1 root root 384 Jan 25 09:33 /usr/bin/python3-futurize
-rwxr-xr-x 1 root root 388 Jan 25 09:33 /usr/bin/python3-pasteurize
-rwxr-xr-x 1 root root 5902 Jan 13 2020 /usr/bin/python3-wsdump
-rwxr-xr-x 1 root root 2555 Apr 14 2020 /usr/bin/python-argcomplete-check-easy-install-script3
-rwxr-xr-x 1 root root 314 Apr 14 2020 /usr/bin/python-argcomplete-tcsh3
This error when trying sudo relates to 2018 year.
After
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
which python3
shows
/usr/bin/python3
which python3.9
/usr/bin/python3.9
One other consequence is that I can not open Terminal(Terminator) form Gnome.
how to fix this? Problems persist again.