I was trying to get ubuntu (22.04) to point to an install of python 3.11 instead of the default 3.10(stupid, didnt know about virtual envs). Unfortunately this lead me to run the following commands.
sudo rm -f /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
Now sudo apt update does't work anymore. Is there anyway I can reinstall default python back to usr/bin?
Trying to reinstall python:
sudo apt install python
[sudo] password for juicebox:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However, the following packages replace it:
2to3 python2-minimal:i386 python2:i386 python2-minimal python2 dh-python python-is-python3
E: Package 'python' has no installation candidate
Sudo apt update call result:
Get:12 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [12.9 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 DEP-11 Metadata [41.5 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 DEP-11 Metadata [18.5 kB]
Fetched 789 kB in 3s (270 kB/s)
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
is there anyway I can recover this?