Score:0

Massive issue with Python

us flag
Tal

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.

ChanganAuto avatar
us flag
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.
Tal avatar
us flag
Tal
@ChanganAuto Is there a way to reinstall it while keeping all my files?
ChanganAuto avatar
us flag
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.
raj avatar
cn flag
raj
If you know/remember what links you have deleted, just create them again.
hr flag
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*`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.