RHEL 8 配置光盘 yum 源

RHEL 8.0 配置光盘 yum 源

RHEL 8 和 7,6 软件包位置不太一样,8 在光盘根目录 BaseOS 文件夹和 AppStream 文件夹里面,7 和 6 是在光盘根目录里面

# 挂载光盘镜像
[root@bogon ~]# mkdir rhel
[root@bogon ~]# mount /dev/cdrom /rhel

# 编辑 repo 文件
[root@bogon ~]# cat /etc/yum.repos.d/media.repo 
[BaseOS]
name=BaseOS
baseurl=file:///rhel/BaseOS
enabled=1
gpgcheck=0
[AppStream]
name=AppStream
baseurl=file:///rhel/AppStream
enabled=1
gpgcheck=0

# 建元数据缓存
[root@bogon ~]# yum makecache               
Failed to set locale, defaulting to C
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.
AppStream                                                                                                                                                                                     3.1 MB/s | 3.2 kB     00:00    
BaseOS                                                                                                                                                                                        2.7 MB/s | 2.7 kB     00:00    
Metadata cache created.

# 查看仓库
[root@bogon ~]# yum repolist               
Failed to set locale, defaulting to C
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:00:06 ago on Mon Aug  5 16:37:58 2019.
repo id                                                                                                     repo name                                                                                                   status
AppStream                                                                                                   AppStream                                                                                                   4672
BaseOS   

猜你喜欢

转载自blog.51cto.com/babyshen/2426762