-3

On Ubuntu 18.04, I uninstalled python* which led to uninstallation of ubuntu-desktop and many other apps. I installed python3.8 and then ubuntu-desktop.

Now I can run command line on ctrl+alt+F3 but I cannot run it under graphical environment. I also tried

cp /etc/skel/.bashrc ~

Followed by logging again and it didn't help.

I also do not know the name of the graphical bash to try reinstalling.

What should I do?


Note: I also set python3.8 as alternative for python. Not sure that makes problem.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2
sudo update-alternatives --config python

And still having problem.

ar2015
  • 417
  • Are you perhaps referring to gnome-terminal – steeldriver Sep 01 '21 at 22:46
  • @steeldriver, thanks. I checked gnome-terminal is installed. Any idea? – ar2015 Sep 01 '21 at 22:48
  • 3
    Ubuntu relies heavily on python, so by removing python the tools that require it to function need to also be removed. The tools also are built for a specific version of python, so if that version isn't available, you'll find they may no longer run (tools such as gnome-terminal requires the python it was built for; what came with your release; that was what it was tested to run with; if your system doesn't have that version - it may not run, or may not run correctly). https://packages.ubuntu.com/bionic-updates/gnome-terminal – guiverc Sep 02 '21 at 00:23
  • @karel, no, it doesn't – ar2015 Sep 06 '21 at 13:38

2 Answers2

2

Ubuntu relies heavily on python, so by removing python the tools that require it to function need to also be removed.

The tools also are built for a specific version of python, so if that version isn't available, you'll find they may no longer run (tools such as gnome-terminal requires the python it was built for; what came with your release; that was what it was tested to run with; if your system doesn't have that version - it may not run, or may not run correctly).

https://packages.ubuntu.com/bionic-updates/gnome-terminal

guiverc
  • 30,396
  • 1
    I'd expect problems when you make changes with the default python (which means python3` for modern releases) unless you're careful and do it properly. Those problems are fixed by restoring things back to what they should be (or doing it correctly). Do your homework before touching python3 on Ubuntu. – guiverc Sep 02 '21 at 00:27
-4

it was fixed after

sudo update-alternatives --config python3

and pointing to python3.6 instead of python3.8.

By the way,

/usr/bin/gnome-terminal

has a head that starts with

#!/usr/bin/python3

Nothing to do with python2.

Still not clear what is the cause.


Update:

You do not need to change the default python version.

Just run

sudo nano '/usr/bin/gnome-terminal'

and change the header to:

#!/usr/bin/python3.6

Done.

Just ensure on the next software update, it is not overwritten.

ar2015
  • 417