I was following the instructions to install Python3.6 on my Ubuntu 16.04 machine from here and in the process I also did some sudo apt-get purge
on some Python3.5 packages (so that I would only keep the 3.6 stuff). Looking at my history I see I did stuff like the following:
sudo apt-get purge python3
sudo apt autoremove
sudo apt-get purge python3.5
sudo apt-get purge python3.5-minimal
sudo apt-get purge python3-minimal
sudo apt-get purge libpython3-stdlib
sudo apt-get purge libpython3.5
sudo apt-get purge libpython3.5-minimal
sudo apt-get purge libpython3.5-stdlib
sudo apt-get --purge autoremove
I also installed python3-pip
.
The end result of the above depradations has (weirdly) messed up with my terminal appearence. Below you see my old terminal appearance to the left (that terminal was launched before the above commands) and the new appearance (to the right):
A number of things aren't right with the new appearence of the terminal:
- no vertical scroll bar (the window to the left automatically shows a scroll bar when it receives focus)
- no menu bar
- different brackground color
- diffrent font and font size
- right mouse click in the terminal window does not allow me to access the terminal's profile (no pop-up menu appears).
I subsequently installed back again the packages I had removed but that didn't solve my problem.
I was initially unable to launch any new terminal at all. Once I did sudo apt-get purge gnome-terminal
I was yet again able to launch new terminals (but with the wrong appearance shown above). If I install gnome-terminal
I again lose the ability to launch new terminal windows. So I think I've lost the ability to launch a new gnome-terminal
and all the new terminal windows I am creating are xterm
terminals.
How can I restore my terminal appearance?
I did the following:
… as advised in this answer. For some reason, this restored my terminal appearance. Now, if I try:
I get the following:
… so obviously something's still not quite alright with my Python 3 (even though I can launch the Python 3 REPL from a terminal just fine) but at least my terminals now look normal.
You successfully screwed up your system. Never remove or otherwise break the
python
orpython3
versions that come preinstalled with Ubuntu! Many important system components require one of these to work.Now about trying to fix things again:
Seemingly your package manager
apt
still works, so go and check out/var/log/apt/history.log
. This logfile contains all package management actions that were performed recently. Check which packages got removed during your process (including all those packages which were automatically removed because they depended on Python) and add them back.After undoing all removals this way, your system should be back in its old state.