搭建本地yum源

 1.删除/etc/yum.repos.d/所有文件

  2.创建yum文件

cat /etc/yum.repos.d/centos.repo
[Centos7]
name=Centos7
baseurl=file:///mnt/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

3.挂载ios至/mnt 

4.执行yum clean all

原文地址:https://www.cnblogs.com/caonw/p/12034587.html