6

I'm fairly new to Linux and I'll make it tl;dr. I installed Ubuntu Server 20.04.4 LTS on my Computer and used it as a server. I only Installed Java, Filezilla, Forge(Minecraft Server) and a Discord bot. Today I unintentionally blocked port 22 for SSH connections so I plugged it on a monitor and did a restart to open the port for SSH. I was welcomed with a GUI which totally confused me. How did the Server version install a GUI without me? I don't want it to use more resources than necessary.

Output of sudo aptitude why gnome:

i   ubuntu-standard Recommends plymouth
i A plymouth        Suggests   desktop-base
p   desktop-base    Suggests   gnome | kde-standard | xfce4 | wmaker

and sudo aptitude why ubuntu-standard:

Manually installed, current version 1.450.2, priority standard    
No dependencies require to install ubuntu-standard

I'm 100% positive I never typed ubuntu-standard into console. How can I revert without formatting again?

Just like @terdon suggested I deleted ubuntu-standard via

sudo apt remove ubuntu-standard filezilla plymouth desktop-base
sudo apt autoremove

Now "why gnome" responds with:

i   grub-efi-amd64-signed Depends  grub-efi-amd64 | grub-pc
p   grub-pc               Depends  grub-pc-bin (= 2.04-1ubuntu26.13)
p   grub-pc-bin           Suggests desktop-base (>= 4.0.6)
p   desktop-base          Suggests gnome | kde-standard | xfce4 | wmaker

What's also interesting is that "echo $XDG_CURRENT_DESKTOP responds with GNOME and sudo apt remove gnome responds with Package 'gnome' is not installed, so not removed.

I'm hella confused...

10
  • 1
    What GUI? Did you see it when restarting, a menu to choose boot options, or did you actually log into a graphical system?
    – terdon
    Mar 4 at 9:59
  • A graphical system. Blue background and taskbar on top. Was able to open Terminal with Ctr+Alt+T. PS: ubuntu server is only os on that computer and it'll boot without me picking it.
    – JennyPenny
    Mar 4 at 10:01
  • 2
    OK. You said you installed Java. What else? Installing a package can also install its dependencies so you may have installed something that needed a GUI and that brought all the GUI stuff in. What is the output of aptitude why gnome (assuming the gnome package is installed).
    – terdon
    Mar 4 at 10:07
  • i ubuntu-standard Recommends plymouth i A plymouth Suggests desktop-base p desktop-base Suggests gnome | kde-standard | xfce4 | wmaker
    – JennyPenny
    Mar 4 at 10:10
  • 3
    Pleaseedit your question and add these details. It looks like you installed the ubuntu-standard meta package and that's what got you your GUI.
    – terdon
    Mar 4 at 10:22

2 Answers 2

11

You installed filezilla which is a graphical FTP client. That would have brought in the other GUI packages.

The other option is that you yourself installed ubuntu-standard, which is what seems to have happened here based on the output of aptitude. This would also install the full GUI environment.

You can now run apt remove ubuntu-standard but since this is a meta package, that won't remove everything it installed. These two commands should remove most of the unnecessary packages:

sudo apt remove ubuntu-standard filezilla plymouth desktop-base
sudo apt autoremove
4
  • If Filezilla installs ubuntu-standard it would make sense. Anyways I removed it (autoremove command not found) and the GUI still pops up but now "why gnome" responds with: i grub-efi-amd64-signed Depends grub-efi-amd64 | grub-pc p grub-pc Depends grub-pc-bin (= 2.04-1ubuntu26.13) p grub-pc-bin Suggests desktop-base (>= 4.0.6) p desktop-base Suggests gnome | kde-standard | xfce4 | wmaker
    – JennyPenny
    Mar 4 at 10:40
  • @JennyPenny sorry, that should have been sudo apt autoremove, my bad. And no, filezilla does not install ubuntu-standard, that really looks like you installed it yourself. Try apt autoremove to see if that helps now. But it now looks like the grub packages require X which is odd.
    – terdon
    Mar 4 at 10:44
  • First things first thank you so much for your effort! apt autoremove did work but a reboot still opened the gui. Would formatting be the better alternative at this point? This seems like a witch hunt now :<
    – JennyPenny
    Mar 4 at 10:47
  • @JennyPenny no, I don't think formatting should be needed. Just remove more and more GUI packages as you find them. Run sudo apt remove gnome && sudo apt autoremove for example. Also wait for someone more knowledgeable than I to answer because I haven't used Debian-based systems in many years so I don't remember the details about this sort of thing.
    – terdon
    Mar 4 at 10:56
10

All those gui application can also be displayed remotely, so having them installed should not be regarded as being wrong if you do not wish a running local gui.

If a local gui is running, then you will probably find the following link in place:

/etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target

If you do not want that, then reset it to:

/etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target

If it's not that link, then search for default.target and reset it to multi-user.target

Another link which may have to be changed is:

/usr/lib/systemd/system/runlevel5.target -> graphical.target
7
  • 1
    Oh thank you very much! "sudo systemctl set-default multi-user.target" did the trick! Output was: "Created symlink /etc/systemd/system/default.target → /lib/systemd/system/multi-user.target." Now it's non gui again thaaaaaaaaaaaaaaanks!!<3
    – JennyPenny
    Mar 4 at 13:01
  • 5
    @JennyPenny note that this (absolutely correct) answer will not free up the disk space used by the GUI tools installed. This might not be a problem for you, you only mentioned "resources" without specifying if you were referring to CPU and RAM or also disk space. If you only care about CPU and RAM usage, this is a perfect solution. If you also want to free up the disk space, however, you will still need to uninstall the packages.
    – terdon
    Mar 4 at 13:54
  • @terdon If you want an X application be displaying remotely (which is what Bib says isn't an unreasonable use case, and I agree), do you need all packets for a GUI on the server or only a subset? Would that depend on whether an entire desktop is displayed remotely, or only single applications on a remote X desktop? (If X is even still the protocol of choice today -- the last time I did something like that is long ago.) Mar 5 at 12:52
  • @Peter-ReinstateMonica same here: I haven't done something like this in years. But yes, I have in the past installed firefox on a remote Ubuntu server machine and then launched via ssh -Y user@remote firefox to have it be displayed here. If (big if) I remember correctly, I needed almost no X packages on the remote, only the direct requirement of firefox since it was my local machine that was doing the rendering. But take this with a huge grain of salt, I am not at all sure I am remembering correctly.
    – terdon
    Mar 5 at 13:58
  • @terdon Firefox uses a fair number of X libraries. Here's what it uses on my system: libX11.so.6.3.0 libX11-xcb.so.1.0.0 libXau.so.6.0.0 libXcomposite.so.1.0.0 libXcursor.so.1.0.2 libXdamage.so.1.1.0 libXext.so.6.4.0 libXfixes.so.3.1.0 libXinerama.so.1.0.0 libXi.so.6.1.0 libXrandr.so.2.2.0 libXrender.so.1.3.0 libXss.so.1.0.0 just after startup with no loading of any pages.
    – Bib
    Mar 5 at 14:18

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.