Linux下的yum仓库的搭建

yum软件仓库

软件仓库搭建的目的

rpm不能自动解决软件依赖关系
yum仓库可以解决此问题

搭建软件仓库的步骤

1.得到与当前系统匹配的系统安装景象文件
2.建立系统安装景象挂载点:
mkdir /softwaresource

3.挂载景象到景象挂载点:
mount /rhel7-xxxxxx.xxxxxx.iso /software
mount /dev/cdrom /software ##基本都用这种方式挂载
在这里插入图片描述
4.配置系统访问软件路径(yum仓库指向文件)
cd /etc/yum.repos.d
cd /etc/yum.repos.d
rm -fr *


#在rhel7中

```bash
vim westos.repo
[westosrhel7]									##仓库名称
name=westos rhel7 source   		##仓库描述
baseurl=file:///softwaresource		## 仓库路径
gpgcheck=0|1									## 软件包授权检测开关
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release #软件包 授权码
enabled=1 										#仓库启 用开关

#在rhel8中

vim westos.repo
[westosAppStream]         		#仓库名称
name=westos rhel7 source AppStream 	#仓库描述
baseurl=file:///softwaresource/AppStream#资源路径
gpgcheck=0|1 			#软件包授权检测开关
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release #软件包授权码
enabled=1 					#仓库启用开关
[westosBaseOS] 					#仓库名称
name=westos rhel7 source BaseOS 	#仓库描述
baseurl=file:///softwaresource/BaseOS 	#资源路径
gpgcheck=0|1 			#软件包授权检测开关
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release #软件包授权码
enabled=1 					#仓库启用开关
5.清空yum缓存识别新文件案内容 

```bash
rhel7:
yum clean all
rhel8
dnf clean all 

```bash

在这里插入图片描述

yum命令

yum install##安装
yum remove##卸载
yum reinstall##重新安装
yum list installed|available|all|软件名称 			##列出
yum update			##更新
yum repolist			##列出仓库信息
yum history			##查看yum历史
yum info					##查看软件包信息 
yum clean all			 ##清除yum缓存
yum search			##根据软件信息搜索
yum whatprovides		  ##根据软件包含文件搜索
yum groups install ##组安装 
yum groups remove #组卸载 
yum groups info #组信息

![在这里插入图片描述](https://img-blog.csdnimg.cn/20200307090043132.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNTQxNjIy,size_16,color_FFFFFF,t_70)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值