Score:0

Removed Python. How to repair ubuntu 20.04 OS without disturbing much of apps?

ht flag

I have a Ubuntu 20.04 LTS version(I am new to Ubuntu), recently I wanted to install the latest version of python i.e. python3.10.0 but was not able to so I looked online and followed many methods but not remember which one worked hence, I won't be able to tell what I used.Then the next day when I tried to open the terminal it was not working so I looked up the internet and it said that it might be because of the recent things I installed and as the latest thing I did was to install python and I remembered a warning regarding the installation of python3.10.0 that came up during the installation process but I ignored it so, I thought of removing python from the system I did that using something as Clt+Alt+F3 but I messed up the python of the OS. Since then many applications are not opening including terminal, is there a way to fix this without installing Ubuntu20.04 again because I don't want to do the process again and then install the third party packages once more and also my important files will be lost. I want a solution that will repair whole OS without disturbing much of apps and packages(It is okay if some apps and packages are removed but not all)

Note: I have synaptic package manager,dconf-editor,gdebi package manager if needed I can use them.

Edit: If everything is removed it is okay and I have created backup for files but don't want to install it over again.

Nmath avatar
ng flag
Numerous parts of Ubuntu rely on the version of python that's distributed with your version of Ubuntu. Installing a different version was a big mistake. You are new to Ubuntu and this mistake will cause widespread problems. You should reinstall. It won't take as long as it will take you to fix all the little problems. It's a good thing you have backups
guiverc avatar
cn flag
If you removed `python3` from the system in your *attempts to fix things* you'll likely find `gdebi` & other tools you had are no longer there; or are not operational (or may do damage instead of helping you); eg. look at https://packages.ubuntu.com/focal/gdebi and you'll see it *depends* on python3 being present & working (*with it being the version the system came with too usually*). You can re-install a desktop system without starting again (do use any option that performs format!)
Nmath avatar
ng flag
If you need a specific python version for a task, set up an environment or use a VM or other container so that it does not wreck your system
us flag
Try this https://askubuntu.com/a/1377304/124466 If it does not work, you will have to reinstall.
us flag
Does this answer your question? [I deleted package 'python3' on Ubuntu and I have lost dashboard, terminal and Unity. Help me to restore my data please](https://askubuntu.com/questions/810854/i-deleted-package-python3-on-ubuntu-and-i-have-lost-dashboard-terminal-and-un)
mrx king avatar
ht flag
Thank you for trying your best but nothing is working, I guess I will have to install it again
guiverc avatar
cn flag
Your *apt* logs (`/var/log/apt/history.log`) should tell what you did exactly did; and thus what will reverse it if you look re: package changes, but until you've re-installed at least python3-minimal (with the correct python3 version & reverse and incorrect version changes) you'll have to limit yourself only to base programs that don't use python (ie. `wget` & `dpkg` etc. will still work); even if easier front-ends aren't currently working as they need python3 fixed first. Again re-install is faster & can auto-reinstall *manually installed* packages from Ubuntu repos & not touch your files.
karel avatar
sa flag
Does this answer your question? [Removed Python 3 and now Ubuntu Software Center, terminal and other applications don't work](https://askubuntu.com/questions/384033/removed-python-3-and-now-ubuntu-software-center-terminal-and-other-applications)
Score:-1
us flag

Try this:

$ apt -f install Reboot. If it's still not right, try: $ dpkg-reconfigure -a Reboot. It should be working for sure, unless you messed up the package database in /var Let us know how it goes. Write down all the errors, in case we need them to further assist you.

I wouldn't worry. I used to get into a mess all the time. It's how you learn!

mrx king avatar
ht flag
I tried both the options but every time a lot of errors come most of them say that some python packages are not properly installed and in the end it comes like this “E: Sub-process /usr/bin/dpkg returned an error code(1)”
us flag
Try this, `$ touch test.txt` `$ apt -f install > test.txt` `$ dpkg-reconfigure -a >> test.txt` Notice there are (2) '>' in the second one. afterward, paste the file to a pasteboard and put the link to it in your question. Also, try `$ ls /var/cache/apt/archives > list.txt` and paste that one too. See if there are any python packages in list.txt. Install them with `$ dpkg -i --force-depends <full path and file name - extension>`
mrx king avatar
ht flag
I tried the commands but every time it says permission denied in both `$ touch test.txt` and `ls/var/cache/apt/archives > list.txt` what shall I do next?
mrx king avatar
ht flag
Shall I format my laptop and install ubuntu again because my work is stuck because this issue as the apps that I use for work are not working .. ?
us flag
If time is a factor, and your not fast at Linux yet, it might make sense to reinstall. You need to use `sudo` for `permission denied` errors.
Someone avatar
my flag
@mrxking no, don't do that, you should not loose hope
Someone avatar
my flag
@Brian What do you even mean? By `apt -f install` ? What will it even do in this case?
us flag
`apt -f install` is designed to rescue a system with package dependency problems. It is so ubiquitous I wrongly assumed my meaning was intuitively obvious. Please accept my apology.
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.