centos7搭建本身的yum源

 

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

1. 安裝nginx,createreponginx

yum install nginx -y
yum install createrepo -y

  

2. 修改nginx配置文件,/etc/nginx/nginx.confpost

location / {
            autoindex on;
        }

  重啓nginx, systemctl restart nginx阿里雲

 

3. 在nginx根目錄創建文件夾.net

mkdir -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit

  

4. 準備同步阿里雲的源,base,updates,extras,epel, 確保/etc/yum.repos.d/ 下只有下面這兩個reporest

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. 開始同步下載包htm

reposync -p /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/

  

6. 建倉blog

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

crontab -e
1 2 * * * /usr/bin/reposync -np /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/

  

 

 

參考自:get

http://blog.csdn.net/u012402276/article/details/53158682

相關文章
相關標籤/搜索