0

Me, being the idiot I am, deleted a few links to python. (I deleted the python3 link I think, as well as a few other write protected files) Now, whenever I make a typo in a command I get this: bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory

Whenever I do sudo apt update I get this:

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 am super stressed and have absolutely no Idea what to do, please help!

Also, Gnome Tweak Tool stopped working.

Tal
  • 1
  • Reinstall Ubuntu and do not mess with the installed python. As you now hopefully understand, python is a core element of the OS and most tools depend on it. – ChanganAuto Nov 29 '21 at 12:29
  • @ChanganAuto Is there a way to reinstall it while keeping all my files? – Tal Nov 29 '21 at 12:32
  • Yes, there is. You have to choose "something else" in the installer then select all the required partitions, usually EFI and root(/), and NOT select format. This will reinstall the OS and keep all your personal files and settings. It'll not install any additional software, that must be manually installed as before but specific settings and history (where applicable) are kept so as soon as you reinstall any given software it'll work exactly as before. – ChanganAuto Nov 29 '21 at 12:35
  • 1
    If you know/remember what links you have deleted, just create them again. – raj Nov 29 '21 at 12:42
  • If you want further help, please [edit] your question to include your Ubuntu version information, as well as the output of ls -ld /usr/bin/python* – steeldriver Nov 29 '21 at 17:08

0 Answers0