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
相关推荐
lcreek6 小时前
Linux信号机制详解:阻塞信号集与未决信号集
linux·操作系统·系统编程
shandianchengzi7 小时前
【记录】Tailscale|部署 Tailscale 到 linux 主机或 Docker 上
linux·运维·docker·tailscale
John Song7 小时前
Linux机器怎么查看进程内存占用情况
linux·运维·chrome
sichuanwuyi7 小时前
Wydevops工具的价值分析
linux·微服务·架构·kubernetes·jenkins
持戒波罗蜜8 小时前
ubuntu20解决intel wifi 驱动问题
linux·驱动开发·嵌入式硬件·ubuntu
不做无法实现的梦~8 小时前
使用ros2来跑通mid360的驱动包
linux·嵌入式硬件·机器人·自动驾驶
点云SLAM8 小时前
C++内存泄漏检测之Windows 专用工具(CRT Debug、Dr.Memory)和Linux 专业工具(ASan 、heaptrack)
linux·c++·windows·asan·dr.memory·c++内存泄漏检测·c++内存管理
肉肉心很软9 小时前
使用onlyoffice实现文件预览编辑 + Docker一键部署流程
运维·docker·容器
LuiChun9 小时前
Docker Compose 容器服务查询与文件查看操作指南(Windows Docker Desktop 版)【一】
linux·运维·windows·docker·容器
${王小剑}9 小时前
在离线ubuntu上布置深度学习环境
linux·运维·ubuntu