The first step is to log in to the root user, enter the network-scripts directory with the command cd / etc / sysconfig / network-scripts /, and find ifcfg-eno16777736 (the specific name may vary depending on the system)
cd /etc/sysconfig/network-scripts/
ls #查看文件
The second step is to open the network configuration file with the command vi ifcfg16777736, enter [i] on the keyboard to edit the mode, add or change at the end of the file, it is not necessary.
vi ifcfg16777736
ONBOOT=yes #启动网络时,启动该设备
DNS1=8.8.8.8
DNS2=2.2.2.2
After editing the content, enter [esc] on the keyboard to exit the editing mode, and enter [shift] +: wq on the keyboard again. Save and exit.
In the new operation line, enter: service network restart Reload the network configuration file to make the configuration file just take effect.
service network restart
Next, ping and check whether you can connect to the external network.
ping www.baidu.com
PS: My personal situation is that an error message appears: ping * UNkonwn (forget the screenshot, I ca n’t remember) The solution is to re-enter: service network restart.
The third step is to obtain and install the GNOME package
Use the yum command to check whether yum can be used normally
yum
After checking OK, enter yum groupinstall "GNOME Desktop" "Graphical Administration Tools" [enter] to install the GNOME graphical interface module.
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
Finally, there will be a prompt [Is this ok [y / d / N] directly select y, press Enter, and then Waiting ... until "Completed!" Appears
! [My personal situation appears the second time Is this ok [y / d / N]
Success!
The fourth step is to modify the default startup mode of CentOS7 to graphical interface mode
Run the systemctl get-default command to view the current startup mode
systemctl get-default #查看当前的启动模式,multi-user.target为命令行模式
systemctl set-default multi-user.target #将默认模式修改为命令行模式
systemctl set-default graphical.target #将默认模式修改为图形界面模式
Change to graphical interface mode with the command systemctl set-default graphical.target
systemctl set-default graphical.target
Enter systemctl get-default again to view the current default mode