1、IP地址配置
[root@localhost ~]# setup
#使用setup工具
或
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
把ONBOOT=“no” 改为
ONBOOT=“yes“
#启动网卡
[root@localhost ~]# service network restart #centos6重启命令
[root@localhost ~]# systemctl restart network #centos7重启命令
#重启网络服务
2、网络yum源
[root@localhost yum.repos.d]# vi /etc/yum.repos.d/CentOS-Base.repo
[base] 容器名称,一定要放在[]中
name 容器说明,可以自己随便写
mirrorlist 镜像站点,这个可以注释掉
baseurl 我们的yum源服务器的地址。默认是CentOS官方的yum源服务 器,是可以使用的,如果你觉得慢可以改成你喜欢的yum源地 址
enabled 此容器是否生效,如果不写或写成enable=1都是生效,写成 enable=0就是不生效
gpgcheck 如果是1是指RPM的数字证书生效,如果是0则不生效
gpgkey 数字证书的公钥文件保存位置。不用修改
3、更换阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache