REHL8 yum 配置

[root@lu8db hgfs]# cat /etc/yum.repos.d/media.repo
[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///mnt/cdrom/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
 
[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///mnt/cdrom/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

mount cdrom to /mnt/cdrom

/dev/cdrom        /mnt/cdrom        iso9660 defaults        0 0
yum clean all
yum makecache

# 查看仓库
yum repolist

dnf -y install 软件包名
dnf -y remove 软件包名
dnf -y update 软件包名



原文地址:https://www.cnblogs.com/tingxin/p/13137951.html