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!
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:
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:
Then enter the commandvi ifcfg-ens33
to open the network configuration file, press thei
key to enter the editing input mode, and add the following content at the end of the file:
Then press the[ESC]
key to exit the edit mode, and then enter the command:wq
to 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:
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:
Successfully pinged, proving that the first The second step of configuration was successful.
3) Install the graphical interface GNOME package:
First enteryum
to check whether yum can be used normally, as shown below:
Then enter the commandyum grouplist
to list the graphical interfaces supported by this system. Many graphical interfaces are supported. We choose the default graphical interface (GNOME Desktop), as shown below:
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:
4) Modify CentOS7 default startup mode to graphical mode:
Enter the commandsystemctl get-default
to 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:
At this time, enter the commandsystemctl get-default
again to view the current modified default The mode isgraphical.target
, which is the graphical interface mode, as shown below:
5) Restart CentOS and check the GUI interface effect:
Enter the commandreboo
t to restart the CentOS system. After the restart, it will switch to the GUI graphical interface mode, as shown below:
Log in to the system and you will see the CentOS desktop, as shown below:
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!