1、新建一个目录
mkdir /var/pkg
2、createrepo来创建repository仓库
createrepo .
3、将本地rpm包放入/var/pkg
4、配置repo
[local]
name=local   --自定义名称
baseurl=file:///var/pkg  --刚新增的包地址
enabled=1
gpgcheck=0
5、清理缓存
yum clean all
yum makecache fast 
6、测试安装软件
yum install --enablerepo=local nfs-utils -y