I accidently deleted /lib/python3.8 [duplicate]
I am a new Ubuntu user running Ubuntu 13.04.
I've been trying to install and use a DeDRM tool, but I've been having problems doing so. I was following some directions that said I needed a version of Python 2.7, but not anything Python 3.0 or later (because 3.0 versions are missing some necessary libraries?). I tried to install Python 2.7.5.6, but it didn't work. I thought it was probably because I had the later version of Python, so I went through terminal and removed Python 3.3, so I could install the earlier version of Python.
Now that I've uninstalled Python 3.3, a lot of applications no longer work, including the terminal and the Ubuntu Software Center. I have no idea how to fix this problem now.
Solution 1:
-
Open a text-only virtual console by pressing the keyboard shortcut Ctrl + Alt + F3.
-
At the
login:
prompt type your username and press Enter. -
At the
Password:
prompt type your user password and press Enter. -
Reinstall the default Python 3 version by running the following command:
sudo apt install python3-all
-
Switch out of the virtual console and return to your desktop environment by pressing the keyboard shortcut Ctrl+Alt+F7. In Ubuntu 17.10 and later press the keyboard shortcut Ctrl+Alt+F2 to exit from the virtual console.
After you have installed the default Python 3 version, you need to get back your default Ubuntu desktop system. In order to avoid messing something up, do it in the following order:
-
First install the terminal from a virtual console using the command:
sudo apt update && sudo apt install gnome-terminal
. If you can't install gnome-terminal at all, skip this step and go to step 2. -
Return to your desktop and open the terminal using the keyboard shortcut Ctrl + Alt + T. In Ubuntu 14.04 and earlier from the terminal install the Ubuntu Software Center using the command:
sudo apt install software-center
In Ubuntu 16.04 and later run this command instead to reinstall the default Software application:
sudo apt install gnome-software
If you still can't open the terminal, run the same command from a virtual console instead. If you can't install the default software application at all, skip this step and go to step 3.
-
Open the terminal and try to open the Ubuntu Software Center from the terminal by running the appropriate command, either
software-center
orgnome-software
. From the Ubuntu Software Center install the Ubuntu desktop system or else open the terminal (or a virtual console) and install the Ubuntu desktop system by running the command:sudo apt update && sudo apt install ubuntu-desktop
.
Solution 2:
This is what I did:
Press Ctrl+Alt+F1 and login.
Run this command:
sudo apt-get remove python/python3
Reboot
Press Ctrl+Alt+F1 and login.
Run these commands:
sudo apt-get install python3
sudo apt-get install python
sudo apt-get install ubuntu-desktop
Reboot
Done!