2

I've installed Ubuntu 19.04 Desktop. I don't actually need/want the desktop environment, but I don't have a keyboard so am only able to install it with a mouse, and onscreen keyboard, which I obviously can't do on the server edition (..?).

There is no functioning Ethernet connectivity on it either, so it has to connect to my network via WiFi, so I can't set it up via SSH, as I'll have to tell it my WiFi password, which will have to be done with the on screen keyboard.

Anyway... So, when viewing htop, I notice that gnome-shell is using about 70%-100% of my CPU all the time after reboot, so I kill it, and all is well.

Am I able to uninstall gnome-shell and have Ubuntu still function properly for my CLI purposes? Or is it integral to the OS? Is it only related to the GUI aspect of my desktop installation, or does it play a role in everything (my docker services, server apps, etc.)?

  • You can uninstall the desktop environment but the better choice for your headless machine will be to install an Ubuntu Server. Especially for network setup... – cmak.fr Jun 27 '19 at 12:08
  • Can you install Ubuntu Server without a keyboard, and without network access? And how would I uninstall the desktop environment? I can't find a solid, modern guide (in the last 4 years, since gnome became mainstream). – Jack_Hu Jun 27 '19 at 12:21
3

Am I able to uninstall gnome-shell and have Ubuntu still function properly for my CLI purposes?

Yes. I can offer an alternative: disable the desktop.

Or is it integral to the OS? Is it only related to the GUI aspect of my desktop installation, or does it play a role in everything (my docker services, server apps, etc.)?

Nope. Though you will also remove all the graphical related tools to your services.


The difference between a server and desktop is only a systemd setting and this will make your system show a login:

sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target

You can then still start the desktop (command is startx).


To revert back to graphical logon:

sudo systemctl enable graphical-user.target --force
sudo systemctl set-default graphical-user.target

The current active option is shown with:

$ systemctl get-default
graphical.target

And ALL the available options are:

RunLevel Units  
  0      runlevel0.target, poweroff.target  Shut down and power off
  1      runlevel1.target, rescue.target    Set up a rescue shell
2,3,4    runlevel[234].target, multi-user.target    Set up a nongraphical multi-user shell
  5      runlevel5.target, graphical.target Set up a graphical multi-user shell
  6      runlevel6.target, reboot.target    Shut down and reboot the system

So you can also use runlevel{number}.target where {number} is the run level.

  • So by running the commands you've kindly supplied, it'll disable gnome from running at startup, but ssh-server, dockerd, etc., will all still start at boot? – Jack_Hu Jun 27 '19 at 14:09
  • 1
    yes sir; all this does is NOT start the desktop (mind that anything in "startup applications" is also not started) Services will all start as usual. – Rinzwind Jun 27 '19 at 14:17
  • So, if I understand Systemd properly, those commands are saying, "don't load any services that are at runlevel 5 or higher"? For completeness (before I accept the answer), can you update your answer to show how you could reverse this process? i.e., how is it set up on my machine at the moment? – Jack_Hu Jun 27 '19 at 15:59
  • How is OP supposed to operate the command line without a keyboard? – xiota Jun 27 '19 at 20:28
  • @xiota "which will have to be done with the on screen keyboard.". and he can ssh into the system after installation so then has a keyboard. – Rinzwind Jun 27 '19 at 20:39
0

You can remove any desktop, and even the graphics server, and you will be left with a fully functional operating system that can be used through the terminal and any terminal based application. You need a keyboard or remote shell access (with keyboard) to operate that, however. If you need a mouse and a virtual keyboard, leave a shell in place with the virtual keyboard software. You may always change to a lighter desktop environment, though any system operation may be difficult and sometimes impossible with only a mouse.

  • Any ideas on how to remove/disable the Gnome desktop? ---- To clarify, the server is setup completely now, and is fine. I can SSH into it to do whatever I need with it. It's just a low-powered machine, so I don't want the extra overhead of running desktop stuff when there's no need. ---- The Desktop version was only ever installed to get it connected to the WiFi (via the onscreen keyboard), so I can SSH into it. Now that it's connected, I don't need the desktop environment anymore (which I'm assuming is what Gnome is?) – Jack_Hu Jun 27 '19 at 14:10
  • See answer of Rinzwind,which you should accept. – vanadium Jun 27 '19 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.