RHEL8上配置yum源

使用iso文件的话:

mount -o loop rhel-8.0-x86_64-dvd.iso /mnt/cdrom

使用光驱的话:

 mount /dev/cdrom /mnt/cdrom

编辑rhel8.repo文件,文件内容见:

[root@rhel8server1 yum.repos.d]# cat /etc/yum.repos.d/rhel8.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
[root@rhel8server1 yum.repos.d]# 

清理:

[root@rhel8server1 yum.repos.d]# dnf clean all
[root@rhel8server1 yum.repos.d]# subscription-manager clean

安装iptraf-ng命令:
 

[root@rhel8server1 yum.repos.d]# dnf install iptraf-ng
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.
Last metadata expiration check: 0:14:31 ago on Sun 19 May 2019 11:04:54 AM EDT.
Dependencies resolved.
=================================================================================================================================================================================================================
 Package                                         Arch                                         Version                                            Repository                                                 Size
=================================================================================================================================================================================================================
Installing:
 iptraf-ng                                       x86_64                                       1.1.4-18.el8                                       InstallMedia-BaseOS                                       310 k

Transaction Summary
=================================================================================================================================================================================================================
Install  1 Package

Total size: 310 k
Installed size: 672 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                         1/1 
  Installing       : iptraf-ng-1.1.4-18.el8.x86_64                                                                                                                                                           1/1 
  Running scriptlet: iptraf-ng-1.1.4-18.el8.x86_64                                                                                                                                                           1/1 
  Verifying        : iptraf-ng-1.1.4-18.el8.x86_64                                                                                                                                                           1/1 
Installed products updated.

Installed:
  iptraf-ng-1.1.4-18.el8.x86_64                                                                                                                                                                                  

Complete!
[root@rhel8server1 yum.repos.d]# 

查看组信息:

[root@rhel8server1 yum.repos.d]# dnf group list
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.
Last metadata expiration check: 0:29:12 ago on Sun 19 May 2019 11:04:54 AM EDT.
Available Environment Groups:
   Server
   Minimal Install
   Virtualization Host
   Custom Operating System
Installed Environment Groups:
   Server with GUI
   Workstation
Installed Groups:
   Container Management
   Headless Management
Available Groups:
   .NET Core Development
   RPM Development Tools
   Smart Card Support
   Development Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Network Servers
   Scientific Support
   Security Tools
   System Tools
[root@rhel8server1 yum.repos.d]# 

 

参考自:https://www.linuxtechi.com/setup-local-yum-dnf-repository-rhel-8/

额外注:按照如下redhat文章居然无法dnf install xxx ,不知道为啥:
Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 8
 https://access.redhat.com/solutions/3776721 

你可能感兴趣的:(RHEL8)