This note explains how to install GUI on CentOS/RHEL 8. During installation, this GUI package was not selected at the software selection phase. And so after installation, the screen boots into CLI prompt and not GUI.
When checked with the Available Environment Groups in grouplist it still shows “Server with GUI” as shown in an example below:
# dnf grouplist This system is receiving updates from Unbreakable Linux Network or Spacewalk. Last metadata expiration check: x:yy:zz ago on Mon xx Oct yyyy Available Environment Groups: Server with GUI ... ...
1. Ensure all the system packages are up to date. Execute the following command to update the system to the latest release from the repository:
2. Execute the following to install the environments for GUI.
# dnf groupinstall "Server with GUI"
The above will install the GUI which otherwise by default gets installed to text mode.
3. Enable GUI on system start up.
# systemctl set-default graphical.target
In CentOS/RHEL 8, systemd uses ‘targets’ instead of runlevels.
4. Issue the following command to enable the GUI on system start.
# ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
4. Reboot the machine and it will boot into GUI.