1、#yum groupinstall "X Window System" -y
2、#yum groupinstall "GNOME Desktop" -y
安装成功后会显示Complete!
PS:
安装过程如遇报错:Transaction check error:
file /boot/efi/EFI/centos from install of fwupdate-efi-12-5.el7.centos.x86_64 conflicts with file from package grub2-common-1:2.02-0.65.el7.centos.2.noarch
则执行#yum upgrade -y 只升级所有包,不升级软件和系统内核,然后再重新执行#yum groupinstall "GNOME Desktop" -y,直至显示Complete!
3、经过上面的操作,系统启动默认还是命令行页面的,需要我们进行切换。如果想要使系统启动即为图形化窗口,需要执行下面的命令
#ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
4、#systemctl get-default //获取当前系统启动模式
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 命令行模式
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target 图形界面模式
5、#reboot
6、更改模式命令:
#systemctl set-default graphical.target //由命令行模式更改为图形界面模式
#systemctl set-default multi-user.target //由图形界面模式更改为命令行模式
参考链接: