当前位置:网站首页>yum本地源制作
yum本地源制作
2022-07-29 05:21:00 【麻辣隔壁4】
本地YUM源制作
- YUM相关概念
- 什么是YUM
YUM(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。
- YUM的作用
在Linux上使用源码的方式安装软件非常满分,使用yum可以简化安装的过程
- YUM的常用命令
安装httpd并确认安装
yum instll -y httpd
列出所有可用的package和package组
yum list
清除所有缓冲数据
yum clean all
列出一个包所有依赖的包
yum deplist httpd
删除httpd
yum remove httpd
- 制作本地YUM源
- 为什么要制作本地YUM源
YUM源虽然可以简化我们在Linux上安装软件的过程,但是生成环境通常无法上网,不能连接外网的YUM源,说以接就无法使用yum命令安装软件了。为了在内网中也可以使用yum安装相关的软件,就要配置yum源。
- YUM源的原理
YUM源其实就是一个保存了多个RPM包的服务器,可以通过http的方式来检索、下载并安装相关的RPM包
- 制作本地YUM源
- 准备一台Linux服务器,用最简单的版本CentOS-6.7-x86_64-minimal.iso
- 配置好这台服务器的IP地址
- 上传CentOS-6.7-x86_64-bin-DVD1.iso到服务器
- 将CentOS-6.7-x86_64-bin-DVD1.iso镜像挂载到某个目录
mkdir /var/iso
mount -o loop CentOS-6.7-x86_64-bin-DVD1.iso /var/iso
- 修改本机上的YUM源配置文件,将源指向自己
备份原有的YUM源的配置文件
cd /etc/yum.repos.d/
rename .repo .repo.bak *
vi CentOS-Local.repo
[base] name=CentOS-Local baseurl=file:///var/iso gpgcheck=1 enabled=1 #很重要,1才启用 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 |
添加上面内容保存退出
- 清除YUM缓冲
yum clean all
- 列出可用的YUM源
yum repolist
- 安装相应的软件
yum install -y httpd
9.开启httpd使用浏览器访问http://192.168.0.100:80(如果访问不通,检查防火墙是否开启了80端口或关闭防火墙)
service httpd start
10.将YUM源配置到httpd(Apache Server)中,其他的服务器即可通过网络访问这个内网中的YUM源了
cp -r /var/iso/ /var/www/html/CentOS-6.7
11.取消先前挂载的镜像
umount /var/iso
12.在浏览器中访问http://192.168.0.100/CentOS-6.7/

- 让其他需要安装RPM包的服务器指向这个YUM源,准备一台新的服务器,备份或删除原有的YUM源配置文件
cd /etc/yum.repos.d/
rename .repo .repo.bak *
vi CentOS-Local.repo
[base] name=CentOS-Local baseurl=http://192.168.0.100/CentOS-6.7 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 |
添加上面内容保存退出
- 在这台新的服务器上执行YUM的命令
yum clean all
yum repolist
- 安装相应的软件
yum install -y gcc
- 加入依赖包到私有yum的repository
进入到repo目录
执行命令: createrepo .
边栏推荐
- 性能对比|FASS iSCSI vs NVMe/TCP
- How to PR an open source composer project
- Reporting Services- Web Service
- MySQL decompressed version windows installation
- Crypto giants all in metauniverse, and platofarm may break through
- Changed crying, and finally solved cannot read properties of undefined (reading 'parsecomponent')
- Extreme deflation and perpetual motion machine model will promote the outbreak of platofarm
- Read and understand move2earn project - move
- Flink connector Oracle CDC 实时同步数据到MySQL(Oracle19c)
- 并发编程学习笔记 之 工具类Semaphore(信号量)
猜你喜欢

Thinkphp6 output QR code image format to solve the conflict with debug

Fantom (FTM) 价格将在未来几天飙升 20%

day02作业之进程管理

“山东大学移动互联网开发技术教学网站建设”项目实训日志四

【数据库】数据库课程设计一一疫苗接种数据库

ssm整合

How can Plato obtain premium income through elephant swap in a bear market?

一文读懂Move2Earn项目——MOVE

Training log 4 of the project "construction of Shandong University mobile Internet development technology teaching website"

Shanzhai coin Shib has a US $548.6 million stake in eth whale's portfolio - traders should be on guard
随机推荐
How to survive in the bear market of encryption market?
Synchronous development with open source projects & codereview & pull request & Fork how to pull the original warehouse
From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
Novice introduction: download from PHP environment to thinkphp6 framework by hand
centos7 静默安装oracle
并发编程学习笔记 之 原子操作类AtomicReference、AtomicStampedReference详解
微信内置浏览器禁止缓存的问题
Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
Bare metal cloud FASS high performance elastic block storage solution
ReportingService WebService Form身份验证
win10+opencv3.2+vs2015配置
How does PHP generate QR code?
熊市慢慢,Bit.Store提供稳定Staking产品助你穿越牛熊
钉钉告警脚本
Detailed steps of JDBC connection to database
并发编程学习笔记 之 工具类Semaphore(信号量)
The LAAS protocol of defi 2.0 is the key to revitalizing the development of defi track
File permissions of day02 operation
NIFI 改UTC时间为CST时间
MOVE PROTOCOL全球健康宣言,将健康运动进行到底