I have recently installed CentOS 7 (Minimal Install without GUI) and now I want to install a GUI environment in it.
How can I install Desktop Environments on previously installed CentOS7 without reinstalling it?
I have recently installed CentOS 7 (Minimal Install without GUI) and now I want to install a GUI environment in it.
How can I install Desktop Environments on previously installed CentOS7 without reinstalling it?
Install GNOME Desktop Environment on here.
# yum -y groups install "GNOME Desktop"
Input a command like below after finishing installation:
# startx
GNOME Desktop Environment will start. For first booting, initial setup runs and you have to configure it for first time.
GNOME Desktop Environments starts like follows.
The default GNOME Desktop of CentOS 7 starts with classic mode but if you'd like to use GNOME Shell, set like follows:
Option A: If you start GNOME with startx
, set like follows.
# echo "exec gnome-session" >> ~/.xinitrc
# startx
Option B: set the system graphical login systemctl set-default graphical.target
(more info) and reboot the system. After system starts
Install KDE Desktop Environment on here.
# yum -y groups install "KDE Plasma Workspaces"
Input a command like below after finishing installation:
# echo "exec startkde" >> ~/.xinitrc
# startx
Install Cinnamon Desktop Environment on here.
First Add the EPEL Repository (EPEL Repository which is provided from Fedora project.)
Extra Packages for Enterprise Linux (EPEL)
How to add EPEL Repository?
# yum -y install epel-release
# sed -i -e "s/\]$/\]\npriority=5/g" /etc/yum.repos.d/epel.repo # set [priority=5]
# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/epel.repo # for another way, change to [enabled=0] and use it only when needed
# yum --enablerepo=epel install [Package] # if [enabled=0], input a command to use the repository
And now install the Cinnamon Desktop Environment from EPEL Repository:
# yum --enablerepo=epel -y install cinnamon*
Input a command like below after finishing installation:
# echo "exec /usr/bin/cinnamon-session" >> ~/.xinitrc
# startx
Cinnamon Desktop Environment will start. For first booting, initial setup runs and you have to configure it for first time.
Cinnamon Desktop Environment starts like follows.
Install MATE Desktop Environment on here (You will need to add the EPEL Repository as explained above in advance).
# yum --enablerepo=epel -y groups install "MATE Desktop"
Input a command like below after finishing installation:
# echo "exec /usr/bin/mate-session" >> ~/.xinitrc
# startx
Install Xfce Desktop Environment on here (You will need to add the EPEL Repository as like above in "Cinnamon" installation before).
# yum -y groupinstall X11
# yum --enablerepo=epel -y groups install "Xfce"
Input a command like below after finishing installation:
# echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
# startx
Rather than make use of the hacking of a startx
command into a .xinitrc
file, it's probably better to tell Systemd that you want to boot into a graphical GUI vs. the terminal.
To accomplish this simply do the following:
$ sudo yum groupinstall "GNOME Desktop"
$ ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
Then simply reboot.
The last bit will associate the runlevel 5 target as your default with respect to Systemd.
You can also use Systemd to accomplish this. This is arguably the better method since you're managing the state of the system directly through Systemd and its CLIs.
You can see what your current default target is:
$ sudo systemctl get-default
multi-user.target
And then change it to graphical:
$ sudo systemctl set-default graphical.target
In Systemd the targets runlevel5.target and graphical.target are identical. So too are runlevel2.target and multi-user.target.
Runlevel Target Units Description
0 runlevel0.target, poweroff.target Shut down and power off the system.
1 runlevel1.target, rescue.target Set up a rescue shell.
2 runlevel2.target, multi-user.target Set up a non-graphical multi-user system.
3 runlevel3.target, multi-user.target Set up a non-graphical multi-user system.
4 runlevel4.target, multi-user.target Set up a non-graphical multi-user system.
5 runlevel5.target, graphical.target Set up a graphical multi-user system.
6 runlevel6.target, reboot.target Shut down and reboot the system.
sudo systemctl set-default graphical.target
. (I prefer sudo yum groupinstall "Server with GUI"
.)
– Trevor Boyd Smith
Jan 27 '17 at 21:06
On CentOS 6
This did work for me:
yum -y groupinstall "X Window System" "Desktop" "Fonts" "General Purpose Desktop"
yum -y groupinstall "KDE Desktop"
yum groupinstall X11
That did the trick for me.
– Mark Fidell Sep 29 '16 at 10:46dhclient
works on virtual box for network client not running.. andyum groupinstall X11
is needed, at least for XFCE install... your answer helped a lot, thanks :) – Sundeep Oct 07 '16 at 10:42gnome-session-is-accelerated: llvmpipe detected.
forstartx
. I'm using CentOS 7 – Jama Oct 28 '16 at 19:54systemctl start graphical.target
to launch immediately. – sekrett Oct 29 '16 at 10:58systemctl
set and then start commands instead of thexinitrc
andxstart
? – Trevor Boyd Smith Jan 27 '17 at 21:09sudo yum groupinstall "Server with GUI"
– Trevor Boyd Smith Jan 27 '17 at 21:10epel
I needed toyum install epel-release
– Stuart Cardall Nov 13 '17 at 19:28GNOME Desktop
installed the Nvidia driver and createdxorg.conf
with explicit nvidia. – basin Apr 26 '18 at 12:46yum install -y mesa-libGLES mesa-libEGL mesa-libGL
– basin Apr 26 '18 at 13:08