Install GUI In CentOS

While there are many different graphical user interfaces available for Linux, in this example we will be using GNOME, which is what CentOS uses by default.

This is as simple as installing the “GNOME Desktop” package group, which is already configured to install hundreds more packages that are required for a GUI installation.

[root@centos7 ~]# yum groupinstall "GNOME Desktop" -y

Note that this may take a while, on my minimal installation I needed to download 280 packages which took up almost 700MB.

Start The GUI

By default after installing the “GNOME Desktop” group of packages, the default target will not have changed, meaning that after a reboot the GUI will not automatically be loaded. We can check the current default target as shown below.

[root@centos7 ~]# systemctl get-default
multi-user.target

The target is similar to the old run levels, in this case multi-user.target is equivalent to run level 3 meaning that after a reboot the GUI will not be loaded here. We instead set the default to the graphical.target which is equivalent to run level 5.

[root@centos7 ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.

[root@centos7 ~]# systemctl get-default
graphical.target

While this has changed the default target which is accessed during system boot, our current target is still the multi-user.target. We can change to the GUI by performing ‘systemctl isolate graphical.target’ which will change us to the GUI immediately.

[root@centos7 ~]# systemctl isolate graphical.target

Alternatively a system reboot would also work, as all future boots should boot to the graphical target by default.

Removing The GUI

If you’ve installed the GUI on a server and realized that it was a terrible mistake, don’t worry! We can also undo this by simply using yum to remove the “GNOME Desktop” package group

[root@centos7 ~]# yum groupremove "GNOME Desktop"

Carefully read through the packages that will be removed and ensure that this looks correct prior to removing packages or dependencies.

  • os, gui, install
  • 5 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

Windows Trail Reset - Windows Server shuts down unexpectedly

Problem: Some of the virtual servers in my infrastructure kept shutting down unexpectedly. All...

Ubuntu E: Failed to fetch .. Hash Sum Mismatch

Ubuntu E: Failed to fetch .. Hash Sum Mismatch, failed to update ubuntu 18.04 OS. nano...

Create or Increase or Remove swap file size on cPanel WHM

Generally, you would want to have a dedicated partition for swap however, a swap file can also be...

How To Add Swap on CentOS 7

Prerequisites Before you begin with this guide, there are a few steps that need to be completed...

“Failed to Synchronize Cache for Repo appstream” Error in CentOS 8

The very recently I had encounterd the “Failed to synchronize cache for repo ‘appstream‘”...

Powered by WHMCompleteSolution