备份当前系统默认 yum
源配置文件
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
查看当前 CentOS7
版本号
[root@localhost ~]# cat /etc/centos-release
到阿里云开源镜像站找到对应的 yum
源版本,详情参考: 阿里yum源 网易yum源
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清除所有yum源缓存文件
[root@localhost ~]# yum clean all
生成yum源缓存
[root@localhost ~]# yum makecache
现在的话你就可以通过:
[root@localhost ~]# yum whatprovides ifconfig
[root@localhost ~]# yum install -y net-tools
使用 ifconfig
查看网卡配置信息
[root@localhost ~]# ifconfig