Linux – Stuck in command line upon reboot in Ubuntu 18.04.4. Can’t access Ubuntu GUI

command linelinuxpasswordsUbuntu

recently I restarted my Ubuntu laptop for the first time and was met with a command line that asked for a login and then a password. At first, I was unable to figure out my password but was eventually able to reset it using recovery mode. However this is when I realized that I was in the command line for linux, fully logged into the system, mind you, but unable to access the GUI. After doing some research online I was able to find a solution using the "startx" command. However, when I do that it simply throws the error "xinit: connection to X server lost". Upon further inspection, it appears that this command is intended for server-hosted linux machines, not my internally-run one. I also tried "sudo init 1-6", but they all just reset me to the same command prompt. Ctrl Alt F1-F12 also have no effect. I've provided a screenshot below that shows what I get when I login to the command prompt and attempt to use "startx". Hope someone can help me with this. Thanks!

I should add that what lead me to reboot my laptop was a weird glitch I experienced with Ubuntu on the GUI login screen, where it would constantly give an authentication error upon selecting my user icon from the list of icons. Basically, I would click on my user icon (techi) be prompted with the password window where you type your password, but before I could type anything some orange text (the type you normally get for mistyping the password) would appear saying that there was an authentication error. after like 1.5 seconds it would then immediately go back to the user selection window.

*UPDATE (same day): I was able to recover some of my files by loading up Ubuntu through a USB, however when I tried logging out as the USB user and logging back in through the "not listed?" feature on the user selection page my username and password wouldn't work.

**UPDATE (4-5-20): I gave up and just reinstalled Ubuntu since it seems that seeking a fix is more trouble then it's worth. Since this was a secondary laptop that I only use for casual programming on the side, a OS reset wasn't a big deal. Now the laptop is working fine. However, if you know how to fix this problem feel free to post it below for other people who don't want to reset. Thank you all for your help!

Screenshot Link

Best Answer

I faced this exact issue.

Before I locked my screen, I wanted to remove all Evolution package files, and made the mistake of doing so by executing sudo apt remove --purge evolution-*.

After I locked the screen, I faced the exact scenario that you described.
Turns out, my mistake removed the ubuntu-desktop package as well (I don't know why).
Installed it again using - sudo apt install ubuntu-desktop and then sudo reboot - voila! Got my desktop back.

Edit: Purging Evolution didn't remove ubuntu-desktop per se, it just deleted some files that support the package.

Related Question