• [转发]centos7搭建自己的yum源


    centos7搭建自己的yum源

    https://www.cnblogs.com/juandx/p/6136621.html
    
    还是需要学习呢 自己之前记得 查过 但是忘记了.
     
     

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

    1. 安装nginx,createrepo

    1
    2
    yum install nginx -y
    yum install createrepo -y

      

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

    1
    2
    3
    location / {
                autoindex on;
            }

      重启nginx, systemctl restart nginx

    3. 在nginx根目录建立文件夹

    1
    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

    1
    2
    3
    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. 开始同步下载包

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

      

    6. 建仓

    1
    2
    3
    4
    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定时同步

    1
    2
    crontab -e
    1 2 * * * /usr/bin/reposync -np /usr/share/nginx/html/CentOS_72_1511_Yum/Aliyun/version_7.2/64bit/
  • 相关阅读:
    hdu5358 推公式+在一个区间内的尺取+枚举法
    poj3349 散列表(hash)
    hdu3282 链表或者对顶堆
    hdu5178 尺取
    hdu5672 尺取
    hdu3244完全背包+二分答案 留坑
    hdu5256 二分求LIS+思维
    hdu5646数学构造+二分
    hdu4190 二分答案
    Python中Scapy网络嗅探模块的使用
  • 原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/11194908.html
Copyright © 2020-2023  润新知