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 分钟前
【教程】MacBook 安装 VSCode 并连接远程服务器
linux·服务器·ide·vscode·ssh·macbook
wodeshijiexialey19 分钟前
Linux系统(Ubuntu和树莓派)的远程操作练习
linux·运维·ubuntu
还没想好取啥名34 分钟前
Linux网络编程(十六)——多线程服务器端的实现
linux·服务器·网络
若云止水1 小时前
ngx_cycle_modules
nginx
龙哥·三年风水2 小时前
ubuntu18-nginx-二进制安装
linux·nginx·ubuntu
ToreanonyTang3 小时前
数据库中的数组: MySQL与StarRocks的数组操作解析
linux·运维·数据库·mysql
南棱笑笑生3 小时前
20250408在荣品的PRO-RK3566开发板使用Rockchip原厂的buildroot系统时拿掉经常出现的list-iodomain.sh警告信息
linux·运维·服务器
诡异森林。3 小时前
Docker--Docker镜像制作的注意事项
运维·docker·容器
耀耀_很无聊4 小时前
03_docker 部署 nginx 配置 HTTPS 并转发请求到后端服务
nginx·docker·https
运维李哥不背锅7 小时前
K8S集群节点负载无故飙升:CPU软死锁解决方案
linux·运维