搭建yum私有仓库

搭建yum私有仓库

1. 创建yum仓库目录

mkdir  -p /app/yum/centos7/x86_64/base

2. 安装createrepo软件

yum -y install createrepo

3.配置阿里yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

4.同步yum源rpm包到本地目录

Vim /etc/yum.conf

Keepcache=0改为1

#保存下载过的软件

reposync -r 仓库id -p 本地目录

reposync -r base -p /app/yum/centos7/x86_64/base

5.初始化repodata索引文件

createrepo -pdo /app/yum/centos7/x86_64/base /app/yum/centos7/x86_64/base

6.提供web服务

>直接用python的http模块

Python -m SimpleHTTPServer 80 &> /dev/null &

>nginx

修改/etc/nginx/nginx.conf

root  /app/yum/centos7/x86_64    #修改服务目录

autoindex on    #开启目录文件显示功能

7.新加入rpm包更新索引文件

createrepo --update /app/yum/centos7/x86_64/

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容