当前位置:网站首页>如何搭建私有yum源
如何搭建私有yum源
2022-07-31 02:31:00 【北在南方】
前言
yum 主要用于自动安装、升级rpm软件包,它能自动查找并解决rpm包之间的依赖关系。要成功的使用 yum 工具安装更新软件或系统,就需要有一个包含各种rpm软件包的repository(软件仓库),这个软件仓库我们习惯称为 yum源。对于能访问到公网环境的机器,可以迅速配置公网的yum源,但是对于私有环境,机器不能访问外网的情况下,需要安装各种lib库,devel 基础依赖的时候,没有yum源是一件极其痛苦的事情。
本文讲述如何搭建私有yum源。
一 主服务器端配置
1.1 创建目录
mkdir -p /data/yum/ky/x86_64/
1.2 安装createrepo软件:
yum -y install createrepo
createrepo -pdo /data/yum/ky/x86_64/ /data/yum/ky/x86_64/
1.3 提供http服务,方便在内网使用
cd /data/yum/ky/x86_64/
python -m SimpleHTTPServer 5901 &>/dev/null &
1.4 上传yum 安装包到目录
这里可以使用当前的yum 配置下载以下rpm 包 但是不安装。比如
yumdownloader openssl-devel nginx libaio-devel mariadb
图
1.5 配置本机可以使用该yum源
### 编辑 poc 安装使用的yum源
vim ky_poc.repo
[ky_poc] # 指定使用 ky_poc 库
name=Server
baseurl=http://127.0.0.1:5888/ #yum仓库IP 端口,python启动服务时指定其他端口
enable=1 # 启用yum
gpgcheck=0 #不检查检查gpg
1.6 更新索引
createrepo --update /data/yum/ky/x86_64
二 客户端配置
2.1 配置yum config
### 备份其他yum 配置文件,如果有的话
cd /etc/yum.repos.d/
mkdir yum_bak
mv * yum_bak
编辑 poc 安装使用的yum源
vim ky_poc.repo
[ky_poc] # 指定使用 ky_poc 库
name=Server
baseurl=http://仓库所在机器ip:5888/ #yum仓库IP 端口,python启动服务时指定其他端口
enable=1 # 启用yum
gpgcheck=0 #不检查检查gpg
2.2 在客户端访问私有yum 源
yum clean metadata dbcache
yum --enablerepo=ky_poc --disablerepo=base,updates,kubernetes,extras,epel,docker-ce-stable list
至此,一个yum源的服务器到使用都配置完毕。当然还有其他动作比定期同步其他官方的rpm 包到本地,保持本地的yum源是最新的状态。
边栏推荐
- Android's webview cache related knowledge collection
- Maximum area of solar panel od js
- ShardingJDBC usage summary
- LeetCode 1161 The largest element in the layer and the LeetCode road of [BFS binary tree] HERODING
- STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode
- 19.支持向量机-优化目标和大间距直观理解
- Word/Excel fixed table size, when filling in the content, the table does not change with the cell content
- Linux下redis7的安装,启动与停止
- cudaMemcpy学习笔记
- 静态路由解析(最长掩码匹配原则+主备路由)
猜你喜欢

19. Support Vector Machines - Intuitive Understanding of Optimization Objectives and Large Spacing

Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things

SQL注入 Less54(限制次数的SQL注入+union注入)

Shell script to loop through values in log file to sum and calculate average, max and min
![LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路](/img/56/fcc8ee6f592abf0a374fc950a3362f.png)
LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路

The real CTO is a technical person who understands products

Between two orderly array of additive and Topk problem

Inter-vlan routing + static routing + NAT (PAT + static NAT) comprehensive experiment

用户交互+格式化输出

19.支持向量机-优化目标和大间距直观理解
随机推荐
The final exam first year course
曼城推出可检测情绪的智能围巾,把球迷给整迷惑了
Inter-vlan routing + static routing + NAT (PAT + static NAT) comprehensive experiment
The modification is not properly placed in the sandbox, causing Apple compatibility issues
Drools Rule Properties, Advanced Syntax
cudaMemcpy study notes
Real-time image acquisition based on FPGA
Force buckled brush the stairs (7/30)
MPPT太阳能充放电控制器数据采集-通过网关采集电池电压容量电量SOC,wifi传输
To write good test cases, you must first learn test design
LeetCode Daily Question 2022/7/25-2022/7/31
LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
The Sad History of Image Processing Technology
跨专业考研难度大?“上岸”成功率低?这份实用攻略请收下!
Verify the integer input
Face detection based on opencv
Word/Excel fixed table size, when filling in the content, the table does not change with the cell content
怎样做好一个创业公司CTO?
Drools规则属性,高级语法
Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things