1. 安装工具
yum install -y createrepo
2. 编辑 comps.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE comps PUBLIC "-//CentOS//DTD Comps info//EN" "comps.dtd">
<comps>
<group>
<id>epc</id>
<name>epc</name>
<name xml:lang="en_GB">epc</name>
<description>epc installation.</description>
<default>false</default>
<uservisible>false</uservisible>
<packagelist>
<packagereq type="mandatory">baicells-epc-base</packagereq>
<packagereq type="mandatory">baicells-epc-ui</packagereq>
<packagereq type="mandatory">baicells-epc-ovs-rest</packagereq>
<packagereq type="mandatory">baicells-epc-ovsdb-agent</packagereq>
<packagereq type="mandatory">baicells-epc-signaltrace</packagereq>
<packagereq type="mandatory">baicells-epc-gwsc</packagereq>
<packagereq type="mandatory">baicells-epc-openapi</packagereq>
</packagelist>
</group>
</comps>
3. 创建仓库
createrepo -g comps.xml . #精确分组
#createrepo .
#createrepo --update
4. 拷贝rpm包到仓库
mkdir rpms
cp *.rpm rpms/
5. 在客户端添加本地yum源
cat>>/etc/yum.repos.d/local.repo<<EOF
[local]
name=local for centos7
baseurl=file://192.168.9.105/root/df/yum #局域网
#baseurl=file:///root/df/yum #本地
enable=1
gpgcheck=0
priority=1
EOF
6. 客户端更新元数据
yum clean all
yum makecache