码迷,mamicode.com
首页 > 其他好文 > 详细

centos7搭建自己的yum源

时间:2016-12-06 13:52:24      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:epel   yum   .net   dir   blank   highlight   htm   nbsp   csdn   

 

 http://www.wenbin.cf/post/37/

1. 安装nginx,createrepo

yum install nginx -y
yum 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.repo

wget -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/Packages
createrepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/extras/Packages
createrepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/updates/Packages
createrepo -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/epel

  

7. crontab定时同步

crontab -e
1 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源

标签:epel   yum   .net   dir   blank   highlight   htm   nbsp   csdn   

原文地址:http://www.cnblogs.com/juandx/p/6136621.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!