当前位置:首页 > 行业动态 > 正文

CentOS minimal 版安装图形界面的步骤是怎样的

CentOS minimal 版是一个非常轻量级的 Linux 发行版,主要用于服务器环境,由于其体积小、性能高,很多开发者和系统管理员喜欢使用它,CentOS minimal 版默认没有图形界面,这对于一些需要操作图形界面的用户来说可能会感到不便,本文将介绍如何在 CentOS minimal 版上安装图形界面。

安装 GNOME 桌面环境

1、确保系统已经更新到最新版本:

sudo yum update

2、安装 GNOME 桌面环境所需的软件包:

sudo yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

3、设置系统默认的运行级别为图形界面:

sudo systemctl set-default graphical.target

4、重启系统使设置生效:

sudo reboot

5、在登录界面,选择 "System boot" > "Automatic login",然后输入用户名和密码登录,登录成功后,系统会自动进入桌面环境。

配置显示效果和主题

1、安装 GNOME Tweaks 工具:

sudo yum install gnome-tweaks

2、运行 GNOME Tweaks,对显示效果进行调整,例如调整分辨率、字体大小等。

3、安装 GNOME Control Center(如果尚未安装):

sudo yum install gnome-control-center

4、点击屏幕右上角的电源图标,选择 "Preferences",在弹出的窗口中可以对显示器进行更多设置。

相关问题与解答

1、如何切换回命令行界面?

答:在登录界面,选择 "System boot" > "Manual",然后输入用户名和密码登录,登录成功后,点击屏幕左下角的 "Applications",选择 "System tools",点击 "Terminal" 即可进入命令行界面,下次启动时,系统会自动恢复到图形界面。

2、如何卸载 GNOME desktop?

答:打开终端,输入以下命令卸载 GNOME Desktop:

sudo yum groupremove "GNOME Desktop" "Graphical Administration Tools"

编辑 /etc/yum.repos.d/CentOS-Base.repo 文件,注释掉或删除与 GNOME Desktop 相关的行,

[base] name=CentOS-$releasever Base OS $basearch Base Repo $namereleasever Base [not recomended] $basearch      []     [updates] name=CentOS-$releasever Updates OS $basearch Updates Repo $namereleasever Updates [not recomended] $basearch      []     [extras] name=CentOS-$releasever Extras OS $basearch Extras Repo $namereleasever Extras [not recomended] $basearch        []     [centosplus] name=CentOS-$releasever Plus OS $basearch Plus Repo $namereleasever Plus [not recomended] $basearch      []     [fasttrack] name=CentOS-$releasever Fasttrack OS $basearch Fasttrack Repo $namereleasever Fasttrack [not recomended] $basearch      []     [epel] name=Extra Packages for Enterprise Linux 7 $basearch      [not recomended]      []     [extras-rpms] name=CentOS-$releasever Extra RPMs for Enterprise Linux 7      [not recomended]      []     [remi] name=Red Hat Enterprise Linux $releasever Server release $basearch      [not recomended]      []     [remi-patches] name=Red Hat Enterprise Linux $releasever Server release Patches for Enterprise Linux $releasever      [not recomended]      []     [gentoo] name=Gentoo $releasever $basearch      [not recomended]      []     [appstream] name=CentOS Stream $releasever $basearch      [not recomended]      []     [rhel-forge] name=Red Hat Enterprise Linux ($releasever) Forge $basearch      [not recomended]      []     [rhel-server] name=Red Hat Enterprise Linux Server $releasever $basearch      [not recomended]      []     [rhel-client] name=Red Hat Enterprise Linux Client $releasever $basearch      [not recomended]      []     [rhel-stdlib] name=Red Hat Enterprise Linux Standard Library $releasever for Enterprise Linux $releasever (Generic)        []     [rhel-source] name=Red Hat Enterprise Linux Source Code ($releasever) for Enterprise Linux ($releasever)        []                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           [base]                                                                                                                                                                                                                        []                                                                                                                                             [updates]                                                                                                                                                                     []                                                                                                                                             [extras]                                                                                                                                                                     []                                                                                                                                             [centosplus]                                                                                                                                                                     []                                                                                                                                             [fasttrack]                                                                                                                                                                     []                                                                                                                                             [epel]                                                                                                                                                                     []                                                                                                                                             [extras-rpms]                                                                                                                                                                     []                                                                                                                                             [remi]                                                                                                                                                                     []                                                                                                                                             [remi-patches]                                                                                                                                                                     []                                                                                                                                             [gentoo]                                                                                                                                                                     []                                                                                                                                             [appstream]                                                                                                                                                                     []                                                                                                                                             [rhel-forge]                                                                                                                                                                     []                                                                                                                                             [rhel-server]                                                                                                                                                                     []                                                                                                                                             [rhel-client]                                                                                                                                                                     []                                        ';}' | sudo tee --append /etc/yum.repos.d/CentOS-Base.repo; sudo yum clean all; sudo yum makecache; sudo yum update; sudo reboot; ```
0