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

相关推荐
AlfredZhao13 小时前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3102 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode2 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
A小辣椒4 天前
TShark:Wireshark CLI 功能
linux
A小辣椒4 天前
TShark:基础知识
linux
AlfredZhao4 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao5 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334665 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪5 天前
linux 拷贝文件或目录到指定的位置
linux
大树886 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai