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

相关推荐
狄加山6751 小时前
Linux Input子系统与驱动开发实战
linux·运维·驱动开发
小刘|1 小时前
对称加密以及非对称加密
linux·运维·网络
Levin__NLP_CV_AIGC3 小时前
更新 / 安装 Nvidia Driver 驱动 - Ubuntu - 2
linux·运维·ubuntu
DLR-SOFT3 小时前
Windows远程访问Ubuntu的方法
linux·运维·ubuntu
咸鱼2333号程序员4 小时前
Linux ifconfig命令详解
linux·服务器·网络
秦jh_4 小时前
【Linux网络】应用层协议HTTP
linux·运维·服务器·网络·网络协议·tcp/ip·http
利刃大大5 小时前
【网络编程】四、守护进程实现 && 前后台作业 && 会话与进程组
linux·网络·c++·网络编程·守护进程
pp-周子晗(努力赶上课程进度版)5 小时前
【计算机网络-数据链路层】以太网、MAC地址、MTU与ARP协议
服务器·网络·计算机网络
AI新视界5 小时前
『Python学习笔记』ubuntu解决matplotlit中文乱码的问题!
linux·笔记·ubuntu
asdfg12589636 小时前
在linux系统中,没有网络如何生成流量以使得wireshark能捕获到流量
linux·网络·wireshark