首页 > 代码库 > centos7搭建自己的yum源
centos7搭建自己的yum源
http://www.wenbin.cf/post/37/
1. 安装nginx,createrepo
yum install nginx -yyum install createrepo -y
2. 修改nginx配置文件,/etc/nginx/nginx.conf
location / { autoindex on; }
重启nginx, systemctl restart nginx
3. 在nginx根目录建立文件夹
mkdir -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit
4. 准备同步阿里云的源,base,updates,extras,epel, 确保/etc/yum.repos.d/ 下只有下面这两个repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repowget -O /etc/yum.repos.d/CentOS-epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
5. 开始同步下载包
reposync -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/
6. 建仓
createrepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/base/Packagescreaterepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/extras/Packagescreaterepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/updates/Packagescreaterepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/epel
7. crontab定时同步
crontab -e1 2 * * * /usr/bin/reposync -np /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/
参考自:
http://blog.csdn.net/u012402276/article/details/53158682
centos7搭建自己的yum源
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。