createrepo centos通过nginx搭建本地源

yum update 先安装一个nginx。

安装Nginx

yum install gcc gcc-c++ pcre pcre-devel openssl openssl-devel libtool zlib zlib-devel -y

cd /usr/local/src

wget http://nginx.org/download/nginx-1.22.0.tar.gz

tar -zxvf nginx-1.22.0.tar.gz

cd nginx-1.22.0

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

make && make install

createrepo

yum install createrepo

复制代码
server {
listen 99;
server_name 本机IP;
charset utf-8;
location /CentOS-7
    {
        autoindex on;
        root /mnt/;
    }
}

cd /mnt

下载包到这个目录

复制代码
[base] 
 
name=CentOS-Local 
 
baseurl=http://对应地址
 
gpgcheck=0 
 
enabled=1 

yum repolist 看一下有没有 CentOS-Local

相关推荐
小坏坏的大世界29 分钟前
VMware 虚拟机无法上网问题排查
服务器·网络
『往事』&白驹过隙;1 小时前
C/C++中的格式化输出与输入snprintf&sscanf
linux·c语言·c++·笔记·学习·iot·系统调用
Je1lyfish1 小时前
CMU15-445 (2026 Spring) Project#1 - Buffer Pool Manager
linux·数据库·c++·后端·链表·课程设计·数据库架构
好好学习天天向上~~1 小时前
12_Linux学习总结_进程地址空间(虚拟地址)
linux·学习
火龙果研究院2 小时前
在CentOS上安装Python 3.13需要从源码编译
开发语言·python·centos
BugShare2 小时前
飞牛NAS笔记本盒盖不休眠
linux
红球yyds2 小时前
haproxy介绍及部署
linux·运维·云原生
切糕师学AI2 小时前
NAT (Network Address Translation,网络地址转换)
运维·服务器·网络
Channing Lewis4 小时前
为什么部署的项目会耗尽系统句柄
服务器
daad7774 小时前
schedule_fair
linux