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)