CentOS7.4下载与安装 Job for network.service failed because the control process exited with error code问题

CentOS7.4下载与安装

1:安装步骤这篇博客挺详细的就不多说了:

https://blog.****.net/qq_39135287/article/details/83993574

2:安装好后需要配置网络环境(不然没法上网)

有关于centos7获取IP地址的方法主要有两种,1:动态获取ip;2:设置静态IP地址

在配置网络之前我们先要知道centos的网卡名称是什么,centos7不再使用ifconfig命令,可通过命令 IP addr查看,如图,网卡名为ens32,是没有IP地址的

CentOS7.4下载与安装
Job for network.service failed because the control process exited with error code问题

1、动态获取ip(前提是你的路由器已经开启了DHCP)

修改网卡配置文件 vi /etc/sysconfig/network-scripts/ifcfg-ens32    (最后一个为网卡名称)

动态获取IP地址需要修改两处地方即可

(1)bootproto=dhcp

(2)onboot=yes

CentOS7.4下载与安装
Job for network.service failed because the control process exited with error code问题

修改后重启一下网络服务即可 systemctl restart network

[root@mini ~]# systemctl restart network
[root@mini ~]# 

重启网卡报错:

network服务启动不了首先保证/etc/sysconfig/network-scripts目录下的ifcfg-xxx(每台机器不一定相同)没有错误(如果你改动过的话),这里的错误指的在更改过程中因为手误敲错字母之类的。

解决:

1.和 NetworkManager 服务有冲突,这个好解决,直接关闭 NetworkManger 服务就好了, service NetworkManager stop,并且禁止开机启动 chkconfig NetworkManager off 。之后重启就好了。

这样动态配置IP地址就设置好了,这个时候再查看一下ip addr 就可以看到已经获取了IP地址,且可以上网(ping 百度)

CentOS7.4下载与安装
Job for network.service failed because the control process exited with error code问题

2、配置静态IP地址

设置静态IP地址与动态iIP差不多,也是要修改网卡配置文件 vi /etc/sysconfig/network-scripts/ifcfg-ens32    (最后一个为网卡名称)

(1)bootproto=static

(2)onboot=yes

(3)在最后加上几行,IP地址、子网掩码、网关、dns服务器

IPADDR=192.168.1.160
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.1
DNS2=8.8.8.8

(4)重启网络服务

[root@mini ~]# systemctl restart network
[root@mini ~]# 

3:跟新系统的应用市场:

 $ sudo yum update

 安装 apt-get

 yum install apt-get  

注意事项:

VirtualBox 设置网络:

CentOS7.4下载与安装
Job for network.service failed because the control process exited with error code问题

 CentOS7.4下载与安装
Job for network.service failed because the control process exited with error code问题