Choosing recovery mode takes me to CLI, not recovery options

Hi all.

I tried to upgrade Xubuntu 20.04 LTS to 22.04 via the terminal (on the way to 24.04). It spat out some errors at the end. Stupidly didn’t take much notice of the details and attempted to fix things with an update/full-upgrade/autoremove (in the terminal). That added plenty pertaining to 22.04, didn’t throw any errors at the end, so I rebooted.

On reboot, chose Xubuntu from the grub menu and got a blank, black, unresponsive screen. Computer has booted as light is on and 22.04 could be right there, but I just can’t see it.

Rebooted by holding down the power button, chose ‘Recovery’ kernel from grub and it boots to a CLI. NO recovery mode options. I can login to the CLI, but if I issue, say, ‘startx’, throws an error about not installed (and I can’t install anything as can’t get online). Which gave me a clue.

When logged into the CLI, I issued ‘echo $XDG_CURRENT_DESKTOP’ and no output resulted. Suggests to me there is no installed desktop as should have shown ‘XFCE’.

  • Bottom line is, when I choose the recovery mode from grub menu, I’m not seeing the recovery options.

Next step: Boot from a Gparted USB so I’ve got a desktop, can dig around and get online. Maybe then I’ll have some hope.

  • Any help/ideas/suggestions greatly appreciated. Any further info required, just ask.

(Using an ASUS Tuf Gaming A15 laptop.)

Your understanding is mostly correct, but the key issue is not recovery mode itself.

In recent Ubuntu/Xubuntu versions, recovery mode normally drops you into a CLI, not a menu. So that part is expected behavior.

What actually broke during the upgrade is the graphical stack:

  • XFCE
  • Xorg
  • display manager (lightdm)

That’s why:

  • Normal boot gives a black screen
  • startx is “not installed”
  • $XDG_CURRENT_DESKTOP is empty

Your system is booting, but the desktop environment is missing or broken.

If you can get internet access (via live USB + chroot, or enabling networking in CLI), the fix is usually to reinstall Xubuntu desktop packages rather than reinstall the whole OS.

3 Likes

Thanks so much for that, MesterP.

I have no idea how to get internet going via CLI, so I’m going to try with a Gparted Live USB which will give me a desktop and internet access.

I should add here that I have been using what was once called Xubuntu-core and is now, I think, Xubuntu minimal for years, therefore, if I ‘reinstall Xubuntu desktop packages’, won’t that install Xubuntu desktop? As in, Xubuntu with all packages and everything that comes with a full install? Don’t want that.

So … could I simply install XFCE, Xorg and lightdm and all will be good, or more to it than that?

PS: Thanks for the tip about ‘recovery mode’ no longer being used in newer releases. That was seriously doin’ my head in! My machines have been rock solid for a long time, so been a long time since I’ve delved much ‘under the bonnet’, so unaware of some of the changes that have happened, obviously enough!

1 Like

This is why I, personally, do not recommend using the full-upgrade command. It solves package conflicts by removing packages.

full-upgrade (apt-get(8))
full-upgrade performs the function of upgrade but will remove
currently installed packages if this is needed to upgrade the
system as a whole.

       When a package is supplied as an argument, the package will be
       installed prior to the upgrade action.

It seems, to me at least, that a conflict has been resolved by removing what I would call the desktop and the Friendly Recovery menu.

Do you have a separate Home partition? With a separate Home partition we can do a re-install without formatting the Home partition which will then not over write the files we have in the Home partition.

Some of us have a partition especially for data. Everything we do not want to lose we keep in the Data partition. A re-install is not so upsetting in this case.

Could you create a partition to transfer important files into using the live session? You might find it less trouble doing a fresh install of Xubuntu minimal then trying to replace what has been removed without adding extra stuff you do not want.

Regards

1 Like

I expect if you had made note of the errors show it would have been related to the fact that you are trying to update an unsupported version to another unsupported version. Support for 22.04 Xubuntu is 3 years. With Ubuntu, you can sometimes access archives to do an upgrade but I don’t know if that is possible with Xubuntu.

https://xubuntu.org/releases/

3 Likes

Thanks for the clarification, that makes sense.

You’re correct: reinstalling the full Xubuntu desktop meta-package would pull in a lot of components you probably don’t want if you’ve been using Xubuntu minimal / core.

In your case, a lighter and cleaner approach is to reinstall only the essentials:

  • xorg
  • xfce4
  • xfce4-goodies (optional)
  • lightdm

That should be enough to restore a working graphical login without turning it into a full Xubuntu install.

Using a live USB (GParted or Xubuntu) to get internet access and then chrooting or installing from there is a perfectly reasonable next step.

And yes — your understanding is spot on: full-upgrade likely resolved a conflict by removing the desktop stack, which explains both the black screen and the missing “recovery menu”.

Glad the recovery-mode clarification helped — things have changed a bit under the hood over the years :slightly_smiling_face:

1 Like

You may already know this, but I would just add that Xubuntu LTS releases have support for 3 years.

https://xubuntu.org/releases/

In your case, both Xubuntu 20.04 and 22.04 are both EOL. It is always recommended to stay on a current release. It may be possible to still do an unsupported upgrade, but normal upgrade behavior should not be expected. For one, the old release packages usually get moved somewhere else and you need to know how to get the correct packages. Others may have done this with success and may be willing to walk you through it, but I am in the camp of doing a back up and install a supported release.

2 Likes

Hi graymech. Yea, I have a home partition. I have actually been at this since … about 2007 I started using Ubuntu. First install was 7.04! I got to be pretty proficient and was a mod on the old Ubuntu Forums for awhile, so not my first rodeo, but I haven’t been ridin’ with this stuff for a long time so …

And thanks, yancek (do I remember that name from the forums?) To you both, I want to try and avoid a full reinstall.

MesterP, thanks for your clarification. Attempted to get a Gparted USB to boot but wouldn’t. Gets stuck on the screen just before it’s about to go to a desktop (with the legals and all). Currently downloading a xubuntu-desktop and see if I can get that to boot to a live desktop from USB. If that doesn’t work, not sure where to go from there.

How do I get online via CLI? I have an ethernet cable plugged in for this. If I can do that, I’d be able to install what you suggest and be back on the bike.

Cheers, all! :wink:

1 Like

You’re very close — the good news is this can be fixed from CLI.

Since you’re using wired ethernet, networking is usually already up even if it’s not obvious.

Please try this step by step from the CLI:

1) Check if the network interface is up

ip a

You should see something like eth0 or enp… with an IP address.

2) Test connectivity

ping -c 3 8.8.8.8

If that works, internet is already available.

3) If DNS is the issue, test:

ping -c 3 google.com

4) If internet works, install only the minimal desktop components (NOT full Xubuntu):

sudo apt update
sudo apt install --no-install-recommends \
xorg xfce4 xfce4-goodies lightdm network-manager

This will give you:

  • XFCE desktop
  • Xorg
  • LightDM login
  • Networking
    without pulling in the full xubuntu-desktop package.

5) Enable the display manager

sudo systemctl enable lightdm
sudo reboot

Notes

  • You are correct: reinstalling xubuntu-desktop would install the full desktop, which you don’t want.
  • Installing XFCE + Xorg + LightDM is the right approach for a minimal setup.
  • Your issue was almost certainly caused by full-upgrade removing desktop packages during conflict resolution.
1 Like

Thanks again. Starting to get a clearer picture of what’s gone on now and what you say makes sense. I did manage to boot from a Live Xubuntu desktop USB, but issue there is won’t mount the drive I want to install stuff on - double-click drive and shows as empty so figure it’s not mounted - and don’t know how to install stuff on the Xubuntu-mini partition in there rather than on the USB install by default even if it did!

Cheers and I’ll get cracking on the CLI method you’ve outlined. :smiley: :+1:

  • Update: Not connected to net.

ip a

… shows my internet devices (lo loopback, wired and wireless);

ping -c 3 8.8.8.8

… gives

ping: connect: Network is unreachable

Also tried

ping -c 3 google.com

… but still unreachable.

Tried in a root shell and CLI.

1 Like

At this point, the main blocker is simply that networking is not up in the CLI, which is why nothing else works yet.

Since you’re on wired Ethernet, try this in the CLI:

sudo dhclient

Then test:

ping -c 3 8.8.8.8

If that works, update and install the minimal components back:

If dhclient fails, paste the output of:

ip route

and we can go one level deeper.

1 Like

Yo the man! dhclient command got me online. But …

After doing an update and running this command

sudo apt install --no-install-recommends xorg xfce4 xfce4-goodies lightdm network-manager

… I attempt to reboot to the Xubuntu install and blank, black, unresponsive screen. Still something missing I guess.

Is that last command to install stuff intended to actually be typed into the terminal as two separate lines with the backward slash after the first line, as in your post?

  • Update: Now I can get to a root shell but no longer to the CLI! Just gives me a blinking cursor in the top left corner. And also, can no longer get online in the root shell for some odd reason. ‘dhclient’ does nothing. Strange.

So, ‘ip route’ gives

default via 192.168.0.1 dev enp2s0
192.168.0.0/24 dev enp2s0 proto kernel scope link src 192.168.0.158
1 Like

Good progress, that tells us a lot :+1:

To clarify first:
Yes, that install command is one single command. The backslash was only for line wrapping in the post.

Now to the actual problem:

  • Your system is booting, but X / the display manager is still failing
  • That’s why you get either a black screen or just a blinking cursor

Next things to check (from the CLI or root shell):

  1. Make sure lightdm is enabled
sudo systemctl enable lightdm
sudo systemctl start lightdm

If it fails:

systemctl status lightdm
  1. Test X directly
startx

If this errors, it usually points to missing graphics drivers.

  1. Important: ASUS TUF Gaming A15
    This laptop often uses NVIDIA graphics.
    If so, you likely need the proprietary driver:
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
  1. Networking note
    Your routing looks fine. If dhclient stops working later, it’s usually because NetworkManager isn’t running yet:
sudo systemctl start NetworkManager

At this point, the issue is almost certainly graphics / display-manager related, not networking anymore.

1 Like

Thanks for that. Looks that way, because starting NetworkManager got me online fine. No need for dhclient.

Here we go. Starting lightdm takes me to blinking cursor, left hand corner. Starting X throws ‘xinit: server error’. Connection refused. Back to the CLI cursor.

‘systemctl status lightdm’ gave a tree of stuff I didn’t understand, but no errors. Looks fine.

ubuntu-drivers devices
command: ubuntu-drivers not found, installed with apt install ubuntu-drivers-common

and

sudo ubuntu-drivers autoinstall
sudo: ubuntu-drivers: command not found

Should I go for ‘apt install ubuntu-drivers-common’ or will this give me a whole lot of what I don’t need?

1 Like

This is actually a good sign — your system and network are working now.

At this point, the black screen + blinking cursor and
xinit: server error usually point to a missing or broken GPU driver,
not missing XFCE packages.

On minimal systems, ubuntu-drivers is not installed by default.
Installing it is safe and won’t pull in a full desktop:

sudo apt install ubuntu-drivers-common

Then run:

ubuntu-drivers devices
sudo ubuntu-drivers autoinstall

This should install the correct graphics driver.

After that:

sudo reboot

If it still fails, please post:

lspci -k | grep -EA3 'VGA|3D|Display'

Beat ya to it. I did

sudo apt install ubuntu-drivers-common
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall

The last command caused a riot of text, most of it seeming to involve the nvidia-driver-580, then stopped with

E: unable to correct problem, you have held broken packages

So, I ran

sudo apt install nvidia-driver-580

… and lo and behold, it installed without issue. Now it gets weird.

I tried booting to the new kernel and black, blank screen, but I can now boot into older kernels, BUT … gives me a regular login screen, login, takes me directly to Kodi! Which I had installed on one of those kernels at one point. I exit from that and takes me back to the login screen.

Reboot back to the recovery kernel of new install and get to ‘hit enter for maintanence’ and now the keyboard is dead! Can’t get into the CLI at all. Completely locked out. This is not good.

Whatever the ‘ubuntu-drivers-common’ and nvidia driver install did screwed something further.

PS: I CAN login to older recovery kernel CLI okay, just seems to be the new recovery kernel that kills the keyboard. If I could fix the ‘held broken packages’ it would be a positive. I’ll try some commands from here.

https://phoenixnap.com/kb/ubuntu-fix-broken-packages

But thinking that’s not going to fix broken packages in the new install (as can’t get into it).

Another day, another mind … twist!

As the older kernel (5.8.0-050800-lowlatency) was booting into Kodi, I used that kernel’s recovery mode to uninstall kodi, booted into the older kernel and voila! A desktop. Not what it was, but I’m typing this from the broken laptop now, albeit not from the 5.15.0-16* kernel. Despite the fact this is an older kernel I’m on, I appear to be running 22.04 Jammy. Some output.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

Some icons are missing, but internet (wired and wireless) and everything else seem to be working as per normal. (And I’ve managed to install Synaptic and the missing Network Manager icon).

Hasn’t changed anything regarding my original problem, unfortuately; when I boot into the 22.04 kernel that was installed during the upgrade, blank screen.

Appears the 5.15.0-16* kernel is missing the graphics drivers. Still. And can’t get into CLI via that kernel’s recovery mode booting that at all (dead keyboard).

  • Here’s some output re. graphics from the old kernel I currently have a desktop in.
~$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0 ==
modalias : pci:v000010DEd00001F95sv00001043sd000016DFbc03sc00i00
vendor   : NVIDIA Corporation
model    : TU117M [GeForce GTX 1650 Ti Mobile]
driver   : nvidia-driver-535-server - distro non-free
driver   : nvidia-driver-535-open - distro non-free
driver   : nvidia-driver-535-server-open - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-570-open - distro non-free
driver   : nvidia-driver-570-server - distro non-free
driver   : nvidia-driver-580-server - distro non-free
driver   : nvidia-driver-545 - distro non-free
driver   : nvidia-driver-535 - distro non-free
driver   : nvidia-driver-570 - distro non-free
driver   : nvidia-driver-570-server-open - distro non-free
driver   : nvidia-driver-580-server-open - distro non-free
driver   : nvidia-driver-580-open - distro non-free recommended
driver   : nvidia-driver-580 - distro non-free
driver   : nvidia-driver-470 - distro non-free
driver   : nvidia-driver-545-open - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

The nvidia-driver-580 (had a dig about and it appears the nvidia-driver-590 is the latest) is the one I installed manually last night. Also guessing some things aren’t installed re. Nvidia either - or not installed correctly - as my Nvidia Settings GUI is considerably watered down (should be a heap of other options and info there).

Also this.

~$ lspci -k | grep -EA3 'VGA|3D|Display'
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile] (rev a1)
	Subsystem: ASUSTeK Computer Inc. TU117M [GeForce GTX 1650 Ti Mobile]
	Kernel modules: nvidiafb, nouveau
01:00.1 Audio device: NVIDIA Corporation Device 10fa (rev a1)
--
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c7)
	Subsystem: ASUSTeK Computer Inc. Renoir
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu

Firstly, thanks to all who attempted to help me with this, but in the end, as I couldn’t get in to the new kernel - not even via recovery in the end - and as the kernel I could get in to was so broken it may have taken a few years to resurrect it, if ever, I did a clean install of Xubuntu-minimal and I’m using it to tap this. All running perfectly.

No idea re. the protocol, but I have marked this thread as ‘Solved’, even though the original issue wasn’t.

Thanks again, one and all.

1 Like

Just a note on this; in the clean Xubuntu-minimal 24.04 install I just did, hitting recovery option from the grub menu does indeed take me to the regular recovery menu, as per normal and as I was expecting originally. :wink:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.