epel仓库提供额外软件包,但是在rhel默认软件包仓库里不可用,需要安装epel rpm包,搭建epel仓库。
所以下载一个epel
百度搜索:epel for rhel8 找到这个包对应的网址
wget下载:
[root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
--2022-02-16 10:50:02-- https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 38.145.60.24, 38.145.60.23, 38.145.60.22
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|38.145.60.24|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23000 (22K) [application/x-rpm]
Saving to: ‘epel-release-latest-8.noarch.rpm’
epel-release-latest-8.noarch.rpm 100%[=====================================================================================================================>] 22.46K 73.5KB/s in 0.3s
2022-02-16 10:50:05 (73.5 KB/s) - ‘epel-release-latest-8.noarch.rpm’ saved [23000/23000]
rpm -ivh安装
安装完成后,查看
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
epel-modular.repo epel-testing-modular.repo xizi.repo
epel.repo epel-testing.repo
[root@localhost yum.repos.d]# cat epel-modular.repo
直接dnf进行查找和安装时,不会保存在系统里,现在要保存的话,需要安装标注的插件:
安装插件:
[root@localhost yum.repos.d]# dnf install yum-utils.noarch -y
安装后,系统中就有了yumdownloader这个命令,就可以下载了
[root@localhost yum.repos.d]# yumdownloader kolourpaint.x86_64
查看
[root@localhost yum.repos.d]# ls
epel-modular.repo epel-testing.repo
epel.repo kolourpaint-21.08.3-1.el8.x86_64.rpm
epel-testing-modular.repo xizi.repo
(在什么下面下载,就在什么地方)
不想下载到当前,下面的指令表示下载仓库中指定软件的安装包到指定/mnt目录
yumdownloader --destdir=/mnt
下载仓库中指定软件安装包和软件依赖性到/mnt目录
yumdownloader --destdir=/mnt kolourpaint.x86_64 --resolve