centos7 nginx搭建本地yum仓库

  • 安装依赖

    复制代码
    yum -y install yum-utils createrepo
  • 创建本地存储目录

    复制代码
    mkdir /data/mirror
  • 同步extras、updates、base、epel仓库到/data/mirror目录

    复制代码
    reposync -n --repoid=extras --repoid=updates --repoid=base --repoid=epel -p /data/mirror
  • 创建仓库索引

    复制代码
    createrepo -po /data/mirror/base/ /data/mirror/base/
    createrepo -po /data/mirror/extras/ /data/mirror/extras/
    createrepo -po /data/mirror/updates/ /data/mirror/updates/
    createrepo -po /data/mirror/epel/ /data/mirror/epel/
  • 更新仓库索引

    复制代码
    createrepo --update /data/mirror/base/
    createrepo --update /data/mirror/extras/
    createrepo --update /data/mirror/updates/
    createrepo --update /data/mirror/epel/
  • nginx配置

    复制代码
    server {
      listen 8090;
      server_name 192.168.200.102;
      location / {
        root /data/mirror/;
        autoindex on;
        index index.html index.htm;
      }
    }
  • 客户端local.repo

    复制代码
    [local_base]
    name=Centos7.9 local base
    baseurl=http://192.168.200.102:8090/base
    enable=1
    gpgcheck=0
    
    [local_extras]
    name=Centos7.9 local extras
    baseurl=http://192.168.200.102:8090/extras
    enable=1
    gpgcheck=0
    
    
    [local_updates]
    name=Centos7.9 local updates
    baseurl=http://192.168.200.102:8090/updates
    enable=1
    gpgcheck=0
    
    [local_epel]
    name=Centos7.9 local epel
    baseurl=http://192.168.200.102:8090/epel
    enable=1
    gpgcheck=0
相关推荐
未济11 小时前
linux 配置环境变量
linux
傲世仙尊11 小时前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫12 小时前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
还是大剑师兰特12 小时前
解决nginx错误:http://localhost:7000正常,http://localhost:7000/map 报错404
nginx·大剑师
_艾伦 耶格尔.13 小时前
进程间通信
linux
AI职业加油站13 小时前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
Liuqy-0513 小时前
Linux IO编程——静态库、动态库
linux
此冬歌咏14 小时前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
彧azz14 小时前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
xing-xing14 小时前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker