版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1333757
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
本文参考了网上资源,经过实测可用,所以在此整理完善,希望能帮到你 …
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this) *关机
# 1 - Single user mode *单用户字符界面;
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) *不具备网咯文件系统功能的多用户字符界面;
# 3 - Full multiuser mode *具有网络功能的多用户字符界面
# 4 - unused *保留不用
# 5 - X11 *具有网络功能的图形用户界面;
# 6 - reboot (Do NOT set initdefault to this) *重启系统。
/etc/inittab
是 inittab 为 linux 初始化文件系统时 init 初始化程序用到的配置文件id:runlevels:action:process
其中某些部分可以为空root
用户登录系统;或者 使用 su
切换到 超级用户模式/etc/inittab
文件vi /etc/inittab
id:5:initdefault:
【修改为 】id:3:initdefault:
id:3:initdefault:
【修改为 】id:5:initdefault:
inittab
已经无法修改,但还是可以查看下里面的内容 vi /etc/inittab
,根据上文的内容就能知晓该如何操作了# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
systemctl get-default
命令,可获取当前模式systemctl set-default multi-user.target
reboot
systemctl set-default graphical.target
reboot