The linux distribution CentOS is widely used on server side without GUI. Which might not come with desktop environment. If you want to install GUI for any kind of reason like connecting to server over VNC or using it on desktop. This article will help you to install GNOME Desktop environment
GNOME is part of GNU Project. It’s official GNU desktop platform. GNOME stands form GNU Network Object Model Environment .
You can more about GNOME graphical shell at it’s official websites
List Installed Desktop Environments
Sometimes it is possible that desktop environment you are looking for to install is installed but not enable. List installed desktop environments using following command
ls -l /usr/share/xsessions/
If you can see your desktop environment skip to Start System with GUI
Install GNOME dekstop environment
On centos all packages related to GNOME dekstop environment are available as group “GNOME Desktop”. Install it using “yum groups install”
yum -y groups install "GNOME Desktop"
It might take a while to install all packages of group “GNOME Desktop”, and also depends on internet speed.
Start System With GUI
After installation you can start GUI from command line manually as follows
(OR) Start our new GNOME GUI systemctl
systemctl isolate graphical.target
Installing GNOME GUI won’t start system with GUI on reboot. You have to enable it, to do so change run level , which is 3 (multi-user networking mode) by default. Change the target to run level 5 which means “run level 3 + display manager” to start system normally with GUI
Check current target
Change default target to start system with GUI
systemctl set-default graphical.target
ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'
Verify Updated target
If you see “graphical.target” , you are good to go. System will start with GUI.
On first run of GNOME GUI, you will be prompted with gnome initial setup. Follow steps
- Select System Language
- Select Keyboard layout
- Following along till the end, you are done.
Uninstall GNOME Desktop Environment
For some reason if you want to uninstall GNOME GUI, you can do it using “yum groups remove ”
yum groups remove "GNOME Desktop"
yum groupremove "GNOME Desktop"
Optionally you can remove any related entries from file ~/.xinitrc .
Quick Summary (Turbo mode)
sudo yum -y groups install "GNOME Desktop" # Install Gnome Dekstop
sudo systemctl set-default graphical.target # Enable GUI on startup
Troubleshooting GNOME GUI installation
- Make sure system is connected to network and able to download packages
- If you don’t see package group install/enable corresponding YUM Repository
- yum plugin protectbase might block install/update of packages. Manage your repositories.
- To solve Issue “conflicts with file from package grub2-common” . Upgrade grub2-common “yum update grub2-common”