搭建yum私有仓库
1. 创建yum仓库目录
mkdir -p /app/yum/centos7/x86_64/base
2. 安装createrepo软件
yum -y install createrepo
3.配置阿里yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
4.同步yum源rpm包到本地目录
Vim /etc/yum.conf
Keepcache=0改为1
#保存下载过的软件
reposync -r 仓库id -p 本地目录
reposync -r base -p /app/yum/centos7/x86_64/base
5.初始化repodata索引文件
createrepo -pdo /app/yum/centos7/x86_64/base /app/yum/centos7/x86_64/base
6.提供web服务
>直接用python的http模块
Python -m SimpleHTTPServer 80 &> /dev/null &
>nginx
修改/etc/nginx/nginx.conf
root /app/yum/centos7/x86_64 #修改服务目录
autoindex on #开启目录文件显示功能
7.新加入rpm包更新索引文件
createrepo --update /app/yum/centos7/x86_64/