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 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值