Centos7 yum镜象源配置
2019-09-09
2
0
在百度中搜索 163 respos.d
找到网址:http://mirrors.163.com/.help/centos.html
里面就是关于centos respos.d的配置方法
1.首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.然后就是 wget 镜象源,改成 Centos-Base.repos
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repo
3.最后就是运行以下命令生成缓存
yum clean all
yum makecache
这样后,如果想查看ifconfig在那个包里,就安装那个包
[root@test ~]# yum provides ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo : @base
Matched from:
Filename : /usr/sbin/ifconfig
这样我们可以安装net-tools包
yum install -y net-tools
-y代表不再询句,以yes默认处理