使用yum命令在CentOS/RHEL 7上安装GNOME桌面


GNOME是一个完全直观且用户友好的CentOS和RHEL 7.x系统桌面环境。最新版本的GNOME桌面包括GNOME 2到GNOME 3以及GNOME Shell桌面。大多数喜欢传统桌面环境的用户可以通过GNOME的经典模式获得它。它也可以通过扩展进行完全配置。如果您已经完成了基本安装,本文将深入介绍如何使用命令行选项在CentOS 7或RHEL 7上安装GNOME GUI。

安装GNOME GUI

要安装GNOME GUI,请使用以下命令:

$ yum grouplist

示例输出应如下所示:

Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Determining fastest mirrors
* base: mirror.nbrc.ac.in
* elrepo: elrepo.reloumirrors.net
* extras: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
google-chrome 3/3
Available Environment Groups:
Minimal Install
Compute Node
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
Server with GUI
GNOME Desktop
KDE Plasma Workspaces
Development and Creative Workstation
Available Groups:
Compatibility Libraries
Console Internet Tools
Development Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done

要安装GNOME桌面组,请输入以下命令(需要root权限):

# sudo yum groups install "GNOME Desktop"

示例输出应如下所示:

Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
base                                  | 3.6 kB 00:00
elrepo                                | 2.9 kB 00:00
extras                                | 3.4 kB 00:00
google-chrome                         | 951 B 00:00
updates                               | 3.4 kB 00:00
(1/3): extras/7/x86_64/primary_db     | 101 kB 00:00
(2/3): updates/7/x86_64/primary_db    | 3.1 MB 00:00
(3/3): elrepo/primary_db              | 348 kB 00:02
google-chrome/primary                 | 1.8 kB 00:00
Loading mirror speeds from cached hostfile
* base: ftp.iitm.ac.in
* elrepo: mirrors.ircam.fr
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
google-chrome 3/3
Warning: Group core does not have any packages to install.
Warning: Group guest-agents does not have any packages to install.
Package gtk2-immodule-xim-2.24.28-8.el7.x86_64 already installed and latest version
.........

要在RHEL 7或CentOS Linux 7服务器上安装GNOME,以便使用GUI操作网络基础设施服务,请输入以下命令:

# sudo yum groups install "Server with GUI"

设置系统直接启动

它允许用户在输入用户名和密码登录时使用GNOME GUI:

# sudo systemctl set-default graphical.target

示例输出应如下所示:

Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.

从命令行启动GUI登录

要从命令行界面启动GUI登录,请使用以下命令:

# sudo systemctl start graphical.target

登录屏幕示例应如下所示:

上述结果显示,操作系统允许用户使用GNOME GUI。恭喜!现在,您知道了“如何使用yum命令在CentOS/RHEL 7上安装GNOME桌面”。我们将在下一篇文章中学习更多关于此类Linux命令的内容。继续关注!

更新于:2019年10月21日

1K+ 次浏览

启动你的职业生涯

通过完成课程获得认证

开始学习
广告