How To Install GNOME GUI In CentOS 7 Linux

By default a full installation of CentOS 7 will have the graphical user interface (GUI) installed and it will load up after system boot, however if we have installed CentOS without the GUI we can always install it later.

This quick guide will cover how to install the GNOME 3 desktop on CentOS 7, which will provide a GUI for working with the Linux system. While I don’t suggest using a GUI on a production server, it’s a good option if you’re using CentOS as a desktop.

GNOME 3

GNOME 3 Desktop

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.


Summary

As shown we can easily install the GNOME desktop group of packages in CentOS 7 Linux, which will provide us with a graphical user interface that can be used for managing and interacting with the system.

Leave a comment ?

10 Comments.

  1. Great it worked like a charm. Thanks!

  2. Hi,

    a little question.

    We’ve installed Linux CentOs 7 and during the installation we’ve choose GNOME Desktop. Everything worked fine till we’ve installed CHROOME.

    From that moment the system will not starts up anymore in GNOME Desktop level.

    On the screen the following appears.

    [ok] reached target Multi-User System.
    [ok] reached target Graphical Interface.
    starting Update UTMP about system run level change.

    How can we fix this problem without a completely reinstall of Linux CentOS 7.

    Thanks.
    Eddy.

    • I’ve had some strange issues with Chrome on CentOS 7 too, I can’t remember the full details as I’ve instead just been using Firefox, something about running it out of the /tmp directory if I recall, sorry if that’s not too useful.

  3. Thank you. it works perfect

  4. Thanks It’s perfect.

  5. Thank you. it worked

  6. I am using the CentOS from Putty client on windows 10 and also have installed GNOME but dont know how to open the GUI as I still see CLI based interface even whenever I login from putty

  7. i am tried but it shows error
    yum install disable please enable or subscribed this
    i have iso which have runlevel 3 only need to install GUI runlevel 5.
    so please suggest what should i do?

  8. Quite helpful solution. Thanks

  9. Hi,
    After installing Gnome, u can Remote desktop connect to the server instead of logging in from putty.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>