Score:0

How to recover Ubuntu GUI?

cn flag

I was working in Ubuntu 16.04 Xenial.

I was trying to upgrade from Python 3.5 to Python 3.8.

After doing pip install, I checked python3 --version it was still showing version 3.5.

So, I removed python 3.5 intending to reinstall Python 3.8 using the following commands:

$sudo apt list --installed | grep "python"

$sudo apt remove python3.5 (or the version the above command returned)

$sudo apt purge python3.5

Now, I see a blank purple screen. I can neither log in to the GUI nor the terminal.

How can I restore the lost system files without damaging working data?

Note: The machine is shared. So, there are other user accounts on the device. Therefore, a fresh install isn't an option.

guiverc avatar
cn flag
[Ubuntu 16.04 LTS has reached the end of it's *standard* support life](https://fridge.ubuntu.com/2021/03/13/extended-security-maintenance-for-ubuntu-16-04-xenial-xerus-begins-april-30-2021/) thus is now off-topic here unless your question is specific to helping you move to a supported release of Ubuntu. Ubuntu 16.04 ESM support is available, but not on-topic here, see https://askubuntu.com/help/on-topic See also https://ubuntu.com/blog/ubuntu-16-04-lts-transitions-to-extended-security-maintenance-esm
guiverc avatar
cn flag
Ubuntu Desktop uses `python3` for many tools; and it only reliably works with the version supplied. When you change the default python3 version, you lose access to those tools; which include GUI terminal, as well as many GUI functions.. Text terminals will still login, so you can reverse you changes (*or just revert your backups*), but 16.04 isn't on-topic here due to EOSS, reaching the end of it's five year *standard* supported life in 2021-April; ESM support options do exist if you do need to use 16.04 (or refer on-topic link for SE *Unix & Linux*)
user535733 avatar
cn flag
You and your fellow users on that machine might revisit "*a fresh install isn't an option*." It should ALWAYS be an option after a catastrophe (which this might be if you lack the skills to fix it). A 6-year-old operating system that's been out-of-support for almost two years is a catastrophe waiting to happen.
guiverc avatar
cn flag
FYI: One of the things I ***love*** about Ubuntu Desktop (and *flavors* of Ubuntu) is that you can non-destructively re-install the system when you make package mistakes, run an *stupid* `rm` type of command to a system directory, and fix the installed system is less than 15 minutes (ie. no user files are touched, and the *manually installed* packages I added get auto-reinstalled). You mention *fresh* install isn't an option; but you do realize that's not your only install option!
us flag
After you have reinstalled, you can create python virtual environments to set up separate versions of python without destroying your system.
us flag
Please don't follow instructions from random posts in quora.... Changing the default Python version would certainly destroy Ubuntu.
Score:1
us flag

I was working in Ubuntu 16.04 Xenial.

Ubuntu 16.04 has been out of support since April 2021. Consider installing a later LTS version (e.g. 22.04, which will be supported until 2027).

Now, I see a blank purple screen. I can neither log in to the GUI nor the terminal. How can I restore the lost system files without damaging working data?

Flash Ubuntu 22.04 on a USB stick, and boot from it. You can use the live session to copy your data to an external hard drive (or, to a partition where Ubuntu is not installed).

Note: The machine is shared. So, there are other user accounts on the device. Therefore, a fresh install isn't an option.

After removing the default python version, none of the users will be able to access the GUI. Reinstalling is the least painful option.

Score:0
tg flag

Launch Ubuntu as you would usually. Allow it to reach the login screen completely. When you arrive, avoid signing in. Instead, on your keyboard, press Ctrl + Alt + F3. Ubuntu will transition from the graphical login screen to a terminal that is just in black and white.

When prompted, type your username. When prompted for your password, type it in. You'll land on a terminal screen that looks familiar. Just as in your graphical terminal windows, you can navigate here.

You should check the file in your home folder. You need to be there right away after logging in. You must look up the file with the proper flags because it is a hidden "dot file." The following command performs a search using ls and grep.

The file's permissions should be mentioned first, followed by its owner's username and group. You've identified the issue's root if "root" is listed there.

user366312 avatar
cn flag
the log-in screen is not visible.
user366312 avatar
cn flag
*Instead, on your keyboard, press Ctrl + Alt + F3.* --- already tried. nothing happens.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.