can we remove GUI layer from ubuntu?

37,988

Solution 1

Ubuntu Server is for exactly this kind of use. It operates in terminal mode all of the time, and takes up much less space as it doesn't contain all of the packages required for the GUI and other associated software.

If you wish to use your current Ubuntu Desktop installation in terminal mode, you can press:

Ctrl+Alt+F1

To switch to a virtual terminal. To get back to the GUI use:

Ctrl+Alt+F7

You can make your Ubuntu desktop boot to text mode by default you can edit the /etc/default/grub file. You'll probably want to make a backup of this file just in case something goes wrong.

  • Comment out the GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, by adding # at the beginning of the line, which will disable the Ubuntu purple screen.
  • Change GRUB_CMDLINE_LINUX="" to GRUB_CMDLINE_LINUX=”text”, this makes Ubuntu boot directly into Text Mode.
  • Uncomment this line #GRUB_TERMINAL=console, by removing the # at the beginning, this makes Grub Menu into real black & white Text Mode

So you'll end up with:

#GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
GRUB_CMDLINE_LINUX=”text”
GRUB_TERMINAL=console

In your /etc/default/grub file. Now it's time to put these changes into effect with:

sudo update-grub

For Ubuntu 15.04 and later

There is one further step for Ubuntu versions which use systemd by default. It's necessary to change the default target from "graphical" target to "multi-user" target.

sudo systemctl set-default multi-user.target

You can always revert to desktop boot later by restoring GRUB config file and running:

sudo systemctl set-default graphical.target

Now, when rebooting, you should find yourself in a lovely console only environment.

Solution 2

Yes, it is possible. You can remove the desktop by using:

sudo apt-get purge ubuntu-desktop

Warning!. This will remove all the related applications of Ubuntu desktop, like nautilus, Ryhtmbox, etc. You will have only a terminal system when it boot up. Be sure to check which applications are removed. Many sensible applications could be deleted.

For more information, look at this thread:

Remove desktop environments

Share:
37,988

Related videos on Youtube

user3290453
Author by

user3290453

Updated on September 18, 2022

Comments

  • user3290453
    user3290453 almost 2 years

    Although this question looks little weird because Ubuntu is meant to be good on GUI based linux. But if I wanted to remove this GUI layer and wanted to leverage only terminal when I boot up my machine. Will this be possible ? If so may I know the proc on how to do it.

    • Mark Kirby
      Mark Kirby almost 8 years
      Just install Ubuntu Server, it has no GUI ubuntu.com/download/server Removing the GUI from a desktop edition will cause problems.
    • Arronical
      Arronical almost 8 years
      Not sure why the Off-topic Vote?
  • Mark Kirby
    Mark Kirby almost 8 years
    That won't work Ubuntu-desktop is only a meta package, it won't remove anything. Did you even read your own link? You took that from a badly written and downvoted answer, not a good or accepted one.
  • GTRONICK
    GTRONICK almost 8 years
    Well, this worked for me time ago, just suggest a better alternative. Thanks for your corrections. :)
  • Mark Kirby
    Mark Kirby almost 8 years
    This does not work, hence the two downvotes already. I don't need to provide an alternative, it is already duped.
  • Steve Childs
    Steve Childs almost 7 years
    This worked perfectly on my Ubuntu 17.04 VM as well. Nice one.
  • hardysim
    hardysim over 5 years
    you can add sudo apt autoremove after this command which will then remove all packages linked to the ubuntu-desktop meta package. This way, everything should be removed correctly