# centos 9 stream 版本
dnf config-manager --set-enabled crb
dnf install epel-release epel-next-release
# RHEL 9.0
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
# AlmaLinux 9
dnf config-manager --set-enabled crb
dnf install epel-release
redhat 9.0 创建本地yum源
1.iso文件方式
$ sudo mkdir /var/repo
$ sudo mount -o loop rhel-baseos-9.0-x86_64-dvd.iso /var/repo/
2.DVD光驱方式
$ sudo mount /dev/sr0 /var/repo/
3.编写repo
$ sudo vi /etc/yum.repos.d/rhel9-local.repo
[Local-BaseOS]
name=Red Hat Enterprise Linux 9 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///var/repo//BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Local-AppStream]
name=Red Hat Enterprise Linux 9 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///var/repo//AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
4.清理缓存
$ sudo dnf clean all
$ sudo subscription-manager clean
警告信息 This system is not registered with an entitlement(系统没有注册权限)。为了抑制这个警告信息,编辑文件 /etc/yum/pluginconf.d/subscription-manager.conf,将参数 enabled=1 改为 enabled=0
$ sudo vi /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0
5.查看仓库
$ sudo dnf repolist
6.安装测试
$ sudo dnf install nfs-utils lrzsz