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

相关推荐
代码AC不AC1 天前
【Linux】进程程序替换
linux·进程·程序替换
Zach_yuan1 天前
UDP网络编程:从入门到精通
linux·网络·网络协议·udp
_叶小格_1 天前
cp、scp、rsync命令详解
linux·运维·服务器·ubuntu·centos·运维开发
凯子坚持 c1 天前
Qt常用控件指南(7)
服务器·数据库·qt
wheeldown1 天前
【Linux网络编程】 Linux TCP网络编程:客户端开发+守护进程实战
linux·网络·tcp/ip
永不复还1 天前
linux 使用Xcb监听键盘鼠标输入
linux·x11·xcb
mango_mangojuice1 天前
Linux学习笔记 1.19
linux·服务器·数据库·笔记·学习
i建模1 天前
linux断点续传下载文件
linux·运维·服务器
执笔论英雄1 天前
【RL]分离部署与共置模式详解
服务器·网络·windows
木卫二号Coding1 天前
Docker-构建自己的Web-Linux系统-Ubuntu:22.04
linux·前端·docker