17

I have uninstalled python3 via:

apt-get remove python

I lost the dashboard and terminal. Even the desktop is blank. Also the top bar which shows time and other setting options are gone. Basically I can see my desktop wallpaper when I open my laptop.

Whenever I open my laptop it shows following before showing the login. However, I can access the Ubuntu advanced options. I need to restore my data because it has my college projects.

Enter image description here

marked as duplicate by karel, αғsнιη, Anwar, Kevin Bowen, Braiam Aug 11 '16 at 20:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 9
    This is why it is always good to read the output of a command before confirming the removal of essential packages. Also, in the future, maybe --dry-run can be helpful to avoid this sort of situation. – Léo Lam Aug 11 '16 at 11:51
  • 4
    why? Why did you think it was a good thing to remove the python package? Basically half of Ubuntu is built in python... – Bakuriu Aug 11 '16 at 15:46
  • 1
    apt-get remove python will remove python 2. – James K Aug 11 '16 at 17:46
49

You can press Ctrl+Alt+F1 to get a shell. Once there, try reinstalling Python and anything else you may be missing:

sudo apt-get install python3-all
sudo apt-get install gnome-terminal

If nothing seems to work properly, or your dependencies have been messed up, try installing all of the desktop components again. This should give you all of the dependencies you need.

sudo apt-get remove ubuntu-desktop
sudo apt-get install ubuntu-desktop
  • 2
    Maybe apt-get install --reinstall instead of separate remove and install commands? – Nobody Aug 11 '16 at 17:31
  • 3
    @Nobody ubuntu-deskop is just a meta package, so a reinstall will effectively do nothing in this case. – Stefano Palazzo Aug 11 '16 at 19:44
  • No, ubuntu-desktop installs all the related packages in my system. After I removed python accidentally when trying to upgrade from 16 to 18. – Vignesh Sep 12 '18 at 11:14
8

Python3 is used by many system components on Ubuntu.. removing that will break a lot (as you just witnessed). Can you try to simply reïnstal Python3 again with sudo apt-get install python3?

  • 2
    His problem appears to be that he has no access to the terminal, therefore has nowhere to enter the command to re-install python – Jon Story Aug 11 '16 at 16:05
3

Your current install is likely damaged beyond repair and needs to be wiped.

Boot up a live CD and mount your current install drive. Copy any important documents to a flash drive and reinstall Ubuntu.

Note that while you may be able to just reinstall Python, there may still be other (deeper) damage that isn't just apparent yet. You can run the following command to try to repair your OS:

sudo apt-get install --reinstall ubuntu-desktop
  • 4
    Note that a 'Live CD' these days can also be a flash drive or in some cases even a phone. – Cronax Aug 11 '16 at 12:41
  • 3
    -1 factually untrue. – Racheet Aug 11 '16 at 16:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.