CENTOS GUI

http://unix.stackexchange.com/questions/181503/how-to-install-desktop-environments-on-centos-7

How to install Desktop Environments on CentOS 7?


up vote56down votefavorite

48

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?

centos gui desktop-environment


shareimprove this question

edited Jul 6 at 3:36

slm

156k36270444

asked Jan 28 ‘15 at 7:02

Afshin Hamedi

2,74331027

 
add a comment

2 Answers

activeoldestvotes


up vote99down voteaccepted

1. Installing GNOME-Desktop:

  1. Install GNOME Desktop Environment on here.

    # yum -y groups install "GNOME Desktop"
    
  2. Input a command like below after finishing installation:
    # startx
    
  3. GNOME Desktop Environment will start. For first booting, initial setup runs and you have to configure it for first time.
    • Select System language first.
    • Select your keyboard type.
    • Add online accounts if you‘d like to.
    • Finally click "Start using CentOS Linux".
  4. GNOME Desktop Environments starts like follows.

How to use GNOME Shell?

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 and reboot the system. After system starts

  1. Click the button which is located next to the "Sign In" button.
  2. Select "GNOME" on the list. (The default is GNOME Classic)
  3. Click "Sign In" and log in with GNOME Shell.

  1. GNOME shell starts like follows:

2. Installing KDE-Desktop:

  1. Install KDE Desktop Environment on here.

    # yum -y groups install "KDE Plasma Workspaces"
    
  2. Input a command like below after finishing installation:
    # echo "exec startkde" >> ~/.xinitrc
    # startx
    
  3. KDE Desktop Environment starts like follows:

3. Installing Cinnamon Desktop Environment:

  1. 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*
      
  2. Input a command like below after finishing installation:
    # echo "exec /usr/bin/cinnamon-session" >> ~/.xinitrc
    # startx
    
  3. Cinnamon Desktop Environment will start. For first booting, initial setup runs and you have to configure it for first time.
    • Select System language first.
    • Select your keyboard type.
    • Add online accounts if you‘d like to.
    • Finally click "Start using CentOS Linux".
  4. Cinnamon Desktop Environment starts like follows.

4. Installing MATE Desktop Environment:

  1. Install MATE Desktop Environment on here.

    # yum --enablerepo=epel -y groups install "MATE Desktop"
    
  2. Input a command like below after finishing installation:
    # echo "exec /usr/bin/mate-session" >> ~/.xinitrc
    # startx
    
  3. MATE Desktop Environment starts.

5. Installing Xfce Desktop Environment:

  1. Install Xfce Desktop Environment on here.

    # yum --enablerepo=epel -y groups install "Xfce"
    
  2. Input a command like below after finishing installation:
    # echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
    # startx
    
  3. Xfce Desktop Environment starts.


shareimprove this answer

edited Jul 6 at 3:38

slm

156k36270444

answered Jan 28 ‘15 at 7:02

Afshin Hamedi

2,74331027

 

    

I tried installing mate following your example. Got an error on groups in the yum command but continued to install. Copy/pasted your commands so there weren‘t any typos. xinit is giving up and not starting mate... what is happening? $ startx xauth: file /home/***/.serverauth.12401 does not exist – Jakke Dec 8 ‘15 at 1:53
    

I downloaded the 7GB version of CentOS 7 and installed it on VirtualBox, and surprisingly, there is no GUI. 7GB as compared to Ubuntu‘s 1GB with GUI. And the step 1 in the answer gave me error "Cannot find a valid baseurl for repo"... oh well... P.S. I just found that it is defaulted to "Minimal installation" during the installation -- you just have to change it to GNOME or something else – 太極者無極而生 Dec 12 ‘15 at 17:02

add a comment


up vote5down vote

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.

Doing it with 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

Targets

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.

References


shareimprove this answer

edited Feb 20 at 14:12

answered Feb 18 at 14:55

slm

156k36270444

 

    

Isn‘t it better to use Systemd commands to enable graphical mode rather than manually creating a symlink? See the Red Hat Systemd Targets Documentation – Mark Edington Feb 20 at 11:54
1  

@MarkEdington - agreed, updated. Thanks for pointing this out. Figured it was possible but hadn‘t dug deep enough to see how. – slm♦ Feb 20 at 14:05

add a comment

protected by Community♦ Feb 10 at 1:03

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you‘re looking for? Browse other questions tagged centos gui desktop-environment or ask your own question.

时间: 2024-08-25 02:44:38

CENTOS GUI的相关文章

linux入门系列2--CentOs图形界面操作及目录结构

上一篇文章"linux入门系列1--环境准备及linux安装"直观演示了虚拟机软件VMware和Centos操作系统的安装,按照文章一步一步操作,一定都可以安装成功.装好系统之后,接下来就是登录操作系统进行各种操作.作为入门系列文章第二篇,将简单介绍CentOs操作系统的特点.图形用户界面(GUI)操作以及目录结构. 正式开始操作之前,我们先来了解一下Linux操作系统相关的知识以及为何本系列文章选择CentOs作为演示环境. 一.Linux介绍 1.1 Linux概述 众所周知,目前

CentOS 7运维管理笔记(1)----设置默认启动模式为GUI模式或命令行模式

昨天在虚拟机中安装CentOS 7时选择了GNOME模式安装,开机默认进入GUI模式.网上搜找修改为默认命令行模式的方法,看到说修改 /etc/inittab文件,在最低下一行添加 id:3 但是 使用 cat /etc/inittab 命令查看inittab文件,可以看到如下内容: 第一个红色方框内的内容表明 inittab不再使用. 第二个红色方框显示了两种启动模式:multi-user.target 和 graphical.target 模式,即名命令行多用户模式和图形界面模式. 第三个红

[转载]CentOS 7安装Gnome GUI 图形界面

原文链接:http://www.centoscn.com/image-text/config/2015/0528/5552.html 当你安装centos服务器版本的时候,系统默认是不会安装 CentOS 的图形界面程序的,比如:gnome或者kde, 那么如果你想在图形界面下工作的话,可以手动来安装CentOS Gnome GUI包,本文将会讲述如何在CentOS 7 系统下安装gnome图形界面程序. 在安装Gnome 包之前,我们需要先检查下安装源是否正常,因为我们要通过yum命令来安装g

如何从光盘本地安装CentOS 7图形界面(Gnome GUI)

本例中通过在CentOS 7中修改repo文件,直接从光盘或者ISO镜像文件安装Gnome图形界面(Gnome GUI),从而避免耗时从官网或镜像下载. 1.首先确保光盘或者ISO镜像文件正确连接到客户机,输入“mkdir /cdrom”在根目录下新建一个名为“cdrom”的文件夹, 继续输入“mount /dev/cdrom /cdrom”将光盘或者ISO镜像文件挂载到根目录下名为“cdrom”目录下,建议输入“ls /cdrom”查看是否正确挂载. 2.输入“vi /etc/yum.repo

centos 服务器命令下安装GUI

第一步:配置YUM源. 无论是使用网络YUM源还是使用CentOS的ISO光盘映像构建本地YUM源. 挂载命令 //创建挂载目录 mkdir /media/cdrom //挂载镜像 mount -t iso9660 /dev/cdrom /media/cdrom 提示:mount:block device /dev/cdrom is write-protected, mounting read-only 就表示成功挂载到/media/cdrom下了. //卸载镜像 umount /dev/hdc

CentOS 7 在迷你系统上安装Gnome GUI图形界面

今天换了台新电脑了,晚上就开始在虚拟机vmware安装CentOS 7系统.兴奋一下,开始了,各项 设置都设备好了.在选择安装系统的版本时,有事走开了,剁手的节奏啊!点到最小化安装了.当时没 注意,后面一步步安装完了,结果直接启动到命令行模式了. 晕,又不想重新安装,直接想从命令行模式安装.在网上找了半天,终于找到一点小提示,分享一下:             1.在命令行下输入下面的命令来安装 Gnome 包 #:$sudo  yum groupinstall "GNOME Desktop&q

在osx下通过vmware无GUI方式运行centos 7

启动虚拟机: /Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion start "CentOS 64-bit.vmwarevm" nogui 停止虚拟机: /Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion stop "CentOS 64-bit.vmwarevm" hard

CentOS 7安装Gnome GUI 图形界面

在安装Gnome 包之前,我们需要先检查下安装源是否正常,因为我们要通过yum命令来安装gnome包, 而yum命令式通过yum 源来下载安装包的. 1.在命令行下输入下面的命令来安装 Gnome 包 1 $sudo  yum groupinstall "GNOME Desktop" "Graphical Administration Tools" 2. 更新系统的运行级别如果你想在系统下次启动的时候自动进入图形界面,那么我们需要更改系统的运行级别,输入下面的命令来

CentOS 7 GUI图形界面安装

在此之前先获取root权限,进行以下命令: 1. 在命令行下输入下面的命令来安装Gnome包: $sudo yum groupinstall "GNOME Desktop" "Graphical Administration Tools" 2. 更新系统的运行级别(下次启动的时候直接进入图形界面): $sudo ln -sf /lib/systemd/runlevel5.target/ /etc/systemd/system/default.target 3. 重启