centos中切换图形与命令行界面

1.在命令行的centos中安装图形化

配置本地源

[root@localhost yum.repos.d]# yum clean all

[root@localhost yum.repos.d]# yum makecache

[root@localhost yum.repos.d]# yum grouplist

clip_image001

安装

[root@localhost yum.repos.d]# yum groupinstall "带 GUI 的服务器" -y

2.切换到桌面版

[root@localhost ~]# startx

clip_image002

要退出图形化的话ctrl+C即可

3.切换到命令行界面

[root@localhost ~]# systemctl get-default #查看当前是什么界面启动

graphical.target # 图形化

multi-user.target # 命令行

[root@localhost ~]# systemctl set-default multi-user.target # 将默认启动修改为命令行界面启动,

重启后,进入的就是命令行界面。

原文地址:https://www.cnblogs.com/liangzb310/p/11053827.html