34

For some reason, I can't open the terminal through the shortcut (terminal icon) in Ubuntu 22.04. It works through Visual Studio Code, though, so that makes me confused. I tried using the F keys, but they are only working to the fn functions (such as controlling the brightness). I am not very knowledgeable on how Ubuntu works, so I am terribly confused.

I did try (unsuccesfully) to change my python version to 3.11.

Edit: The contents of /usr/share/applications/org.gnome.Terminal.desktop:

[Desktop Entry]
Name=Terminal
Comment=Use the command line
Keywords=shell;prompt;command;commandline;cmd;
TryExec=gnome-terminal
Exec=gnome-terminal
Icon=org.gnome.Terminal
Type=Application
Categories=GNOME;GTK;System;TerminalEmulator;
StartupNotify=true
StartupWMClass=Gnome-terminal
X-GNOME-SingleWindow=false
OnlyShowIn=GNOME;Unity;
Actions=new-window;preferences;
X-Ubuntu-Gettext-Domain=gnome-terminal

[Desktop Action new-window] Name=New Window Exec=gnome-terminal --window

[Desktop Action preferences] Name=Preferences Exec=gnome-terminal --preferences

5 Answers5

39

If you try to change your python version in Ubuntu, it will most certainly cripple your environment. Python is an integral part and may not be changed under any circumstances. There are many questions & answers about it in this forum.

What could you do?

Depending on how you installed it, try to remove every remnant of your python 3.11.x and install the original python from the repos.

Since you cannot open terminal, open a virtual terminal with ctrl + alt + f3 and login with your username and password.

If your "orignal" version was not removed, you may tell the system to use it again:

sudo update-alternatives --config python3

Select the Version 3.10.6, if provided.

If the alternatives group was removed, that will not work. Try this command:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
sudo update-alternatives --config python3

If all else fails you may need to reinstall Ubuntu.

What if you need another python version?

There are many possible ways to install any python version in a special environment like "pipenv", "anaconda", "venv", you name it. See here for a small overview of virtual environments.

The current python version in Ubuntu 22.04 is 3.10.6 as of today.

wjandrea
  • 14,504
kanehekili
  • 7,426
12

Had a similar issue, a youtube video resolved my case, without using any cmd line. Go to settings -> Language&Settings -> Change English (United States) to English (Canada) then restart.

Inno
  • 121
2

An alternative to kanehekili's answer: my problem was that I redirected the python and python3 links in /bin to my newly-installed python3.11 (instead of the original python3.10).

So I had to:

  1. Go into virtual terminal mode (with CTRL + ALT + F3).
  2. cd /bin
  3. Verify the bad state with ln -s | grep python (see the bad python/python3 directions).
  4. Remove soft links with sudo rm ./python and sudo rm ./python3.
  5. Create new soft links with sudo ln -s python3.10 python3 and sudo ln -s python3 python.
  6. Close virtual terminal mode (with CTRL + ALT + F2).

After that everything worked.

A. Kali
  • 121
0

For me it was Default Locales.

nano /etc/default/locales

Remove lines that have "LC" or just delete all lines. Reboot.

SamTzu
  • 91
0

I had to update my locale settings in ubuntu:

sudo update-locale LANG=de_DE.UTF-8 LC_MESSAGES=POSIX

Maybe you have to renew your locales or set it to your country.

Andy
  • 1
  • 2