Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface

藏色散人
Release: 2021-04-09 19:25:17
forward
19059 people have browsed it

The following tutorial column ofcentoswill introduce to you how to solve the problem that CentOS7 does not have a graphical interface and how to install a graphical interface. I hope it will be helpful to friends in need!

Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface

When we install CentOS7, if we choose "minimize" installation then The system only has a command line interface, but no graphical interface, as shown below:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
The complete steps to solve the problem are as follows:
1) Start CentOS7 and log in as the root user (you must log in as the root user, Other ordinary users do not have enough permissions), where localhost login is root and Password is the password of the root user.

2) Configure the network card to ensure connectivity with the external network (if there is no connectivity, subsequent operations will not be possible):
Enter the commandcd /etc/sysconfig/network- in the command line interface scripts/Enter the network-scripts directory, and then enter ls to see which directories are in the network-scripts directory. At this time, we will see a file named ifcfg-ens33, as shown below:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
Then enter the commandvi ifcfg-ens33to open the network configuration file, press theikey to enter the editing input mode, and add the following content at the end of the file:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
Then press the[ESC]key to exit the edit mode, and then enter the command:wqto save and exit the network configuration file, and then be sure to reload the network configuration file, because only The configuration we just made will take effect after reloading. The command entered to reload the network configuration file isservice network restart, as shown below:

Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
At this time After the configuration is completed, check whether you can access the external network. Enter the commandping -c 3 www.baidu.com, as shown below:

Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
Successfully pinged, proving that the first The second step of configuration was successful.

3) Install the graphical interface GNOME package:
First enteryumto check whether yum can be used normally, as shown below:

Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
Then enter the commandyum grouplistto list the graphical interfaces supported by this system. Many graphical interfaces are supported. We choose the default graphical interface (GNOME Desktop), as shown below:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
Then enter the commandyum groupinstall "GNOME Desktop" "Graphical Administration Tools"Obtain and install the CentOS default graphical interface GNOME package, (the case cannot be changed, Linux is strictly distinguished uppercase and lowercase).

During the installation process, there will be a prompt similar to "... is ok? (y/b/n)", just select y and press Enter. Then wait for the automatic installation (when I installed it myself, it took about ten minutes due to poor network speed) until it prompts "Completed!", indicating that the GNOME package has been installed, as shown below:

Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
4) Modify CentOS7 default startup mode to graphical mode:
Enter the commandsystemctl get-defaultto view the current default mode asmulti-user.target, That is, the command line mode, we need to modify it to the graphical interface mode, as shown below:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
At this time, enter the commandsystemctl get-defaultagain to view the current modified default The mode isgraphical.target, which is the graphical interface mode, as shown below:

Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
5) Restart CentOS and check the GUI interface effect:
Enter the commandreboot to restart the CentOS system. After the restart, it will switch to the GUI graphical interface mode, as shown below:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
Log in to the system and you will see the CentOS desktop, as shown below:
Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface
All the above operations from the command line to the graphical interface are completed.

The above is the detailed content of Solve the problem that CentOS7 does not have a graphical interface and install the graphical interface. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!