How do I stop the GUI (in Kubuntu 21.10)

I need to stop the GUI and access a TTY for the NVIDIA drivers. I found this question. However, when I tried sudo service lightdm stop (or the same with gdm), it said this:

$ sudo service lightdm stop
Failed to stop lightdm.service: Unit lightdm.service not loaded.
$ sudo service gdm stop
Failed to stop gdm.service: Unit gdm.service not loaded.

I'd prefer not have to mess with Grub, as I only need to stop the GUI once. So, how do I stop the GUI to use a TTY with no GUI running at all in Kubuntu 21.10?

Note: I know how to access a TTY. But once I'm in the TTY, I need to stop the GUI, as the NVIDIA driver installer wants me to be in a TTY and have the GUI not running.


Solution 1:

Kubuntu uses sddm as the display manager. So

sudo service sddm stop

should do it.

Solution 2:

For me, doing the following (in a TTY) worked to stop the GUI.

$ sudo init 3

After I ran that, I was able to successfully install my NVIDIA GPU driver.

Solution 3:

You can also ask systemd to get into multi-user.target by using below command:

sudo systemctl isolate multi-user.target

And after all TTY-based operations get finished jump back to graphical session by

sudo systemctl isolate graphical.target