第19章 软件包管理

1.rpm 命令用于软件包管理器

[root@dsrw ~]# rpm -ivh eple-release-latest-8.norach.rpm
错误:打开 eple-release-latest-8.norach.rpm 失败: 没有那个文件或目录
[root@dsrw ~]#  rpm -hvi epel-release-latest-8.noarch.rpm
警告:epel-release-latest-8.noarch.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 2f86d6a1: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:epel-release-8-18.el8            ################################# [100%]
Many EPEL packages require the CodeReady Builder (CRB) repository.
It is recommended that you run /usr/bin/crb enable to enable the CRB repository.

[root@dsrw ~]# rpm -qi epel-release-latest-8.noarch.rpm
警告:epel-release-latest-8.noarch.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 2f86d6a1: NOKEY
Name        : epel-release
Version     : 8
Release     : 18.el8
Architecture: noarch
Install Date: (not installed)
Group       : Unspecified
Size        : 35504
License     : GPLv2

2.yum( Yellow dog Updater, Modified)是一个在 Fedora 和 RedHat 以及 SUSE 中的 Shell 前端软件包管理器。

1)编辑本地软件仓库源

[root@dsrw ~]# vim /etc/yum.repos.d/rhel8.repo
[BaseOS]
name=-BaseOS
baseurl=file:///mnt/cdrom/BaseOS
gpgcheck=0
enabled=1

[AppStream]
name=AppStream
baseurl=file:///mnt/cdrom/AppStream
gpgcheck=0
enabled=1

2)清理缓存元数据

[root@dsrw ~]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
25 文件已删除

3)建立元数据

[root@dsrw ~]# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Extra Packages for Enterprise Linux 8 - x86_64  3.4 MB/s |  13 MB     00:03    

4)查看在用的yum源

[root@dsrw ~]# yum repolist all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:00:23 前,执行于 2022年12月28日 星期三 16时29分43秒。
仓库标识                       仓库名称                              状态
AppStream                      AppStream                             启用: 4,672
BaseOS                         -BaseOS                               启用: 1,658
*epel                          Extra Packages for Enterprise Linux 8 启用: 9,504

5)安装服务

[root@dsrw ~]# yum install -y httpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:02:51 前,执行于 2022年12月28日 星期三 16时29分43秒。
Package httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64 is already installed.
依赖关系解决。
无需任何处理。
完毕!

3.dnf 命令更好的解决了软件依赖问题

[root@dsrw ~]# dnf install -y vsftpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:04:21 前,执行于 2022年12月28日 星期三 16时29分43秒。
依赖关系解决。
================================================================================
 软件包          架构            版本                  仓库                大小
================================================================================
Installing:
 vsftpd          x86_64          3.0.3-28.el8          AppStream          180 k

事务概要
================================================================================
安装  1 软件包

总计:180 k
安装大小:356 k
下载软件包:
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中      :                                                             1/1 
  Installing  : vsftpd-3.0.3-28.el8.x86_64                                  1/1 
  运行脚本    : vsftpd-3.0.3-28.el8.x86_64                                  1/1 
  验证        : vsftpd-3.0.3-28.el8.x86_64                                  1/1 
Installed products updated.

已安装:
  vsftpd-3.0.3-28.el8.x86_64                                                    

完毕!
© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容