centos7-11-install and uninstall graphical user interface

1 Install the graphical interface

After installing centos7, the system defaults to the command line interface. If there are special needs, then we need to manually install the user graphical interface.
(1) Check the current run level and the group that can be installed
#systemctl get-default

输出显示
graphical.target

#yum grouplist
Insert picture description here
There are two types of default run levels in centos7: multi-user.target and graphical.target.

Insert picture description here(2) Update the running level of the system to graphical.target, and set the default startup graphical interface
#systemctl set-default graphical.target
#ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

(3) Install the X window system
#yum -y update upgrade all packages and also upgrade the software and system kernel to
enter root mode. Because of permission restrictions, we need to enter root mode. Use root to log in when booting or switch to root user during system operation. can.
First install X (X Window System), the command is
#yum groupinstall “X Window System”//note that there are quotation marks,
and then the system will automatically find the nearest network to download related files
(4) Install the graphical interface software GNOME
and then we start to install us The required graphical interface software, GNOME (GNOME Desktop).

Be sure to note that the name must correspond, otherwise the error No packages in any requested group available to install or update will appear. This is because the software names of different versions of CentOS may be different (other Linux systems are similar)
#yum groupinstall “GNOME Desktop” “Graphical Administration Tools”
(5)
You can enter the graphical interface through the command startx. The first time you enter it will compare Slow, please be patient. (May need to restart, the command is reboot)

2 Switch back to the command line interface

#systemctl set-default multi-user.target

输出显示
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.

Guess you like

Origin blog.csdn.net/qq_20466211/article/details/113466428