Red Hat 8.0 本地源配置方法

Red Hat 8.0 本地源配置方法


# 项目场景:

升级了红帽系统8.0后。按照之前的老方法配置了本地yum源提示了
[rhel8.0]
name=rhel8.0
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0

新建挂载目录
mkdir -p  /media/cdrom

挂载
mount  /dev/cdrom /media/cdrom

查看是否挂载成功(此处已删除多余部分,出现以下说明挂载成功)
[root@localhost cdrom]# df -h
Filesystem              Size  Used Avail Use% Mounted on
/dev/sr0                6.7G  6.7G     0 100% /media/cdrom

# 问题描述:
安装http服务报以下报错
[root@localhost yum.repos.d]# yum install http
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.
Repository rhel8 is listed more than once in the configuration



# 原因分析:

【RHEL8】
Linux—RHEL8配置本地YUM 源,按照之前传统的配置本地YUM的方法肯定不行,
在RHEL8版本的软件源发生了变化,在RHEL8版本的软件仓库分成了两部分
【AppStream和【BaseOS】,所以我们在配置YUM 源的适合需要配置连个部分;

BaseOS存储库旨在提供一套核心的底层操作系统的功能,为基础软件安装库。
AppStream存储库中包括额外的用户空间应用程序、运行时语言和数据库,以支持
不同的工作负载和用例。AppStream中的内容有两种格式——熟悉的RPM格式和称为
模块的RPM格式扩展。


# 解决方案:

1.重新修改yum源的配置。配置如下
[root@localhost yum.repos.d]# cat rhel8.repo 

[BaseOS]
name=BaseOS
baseurl=file:///media/cdrom/BaseOS
enabled=1
gpgcheck=0

[Appstream]
name=AppStream
baseurl=file:///media/cdrom/AppStream
enabled=1
gpgcheck=0

2、清理缓存、建立元数据
[root@localhost yum.repos.d]# yum makecache

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                                                     38 MB/s | 5.3 MB     00:00    
BaseOS                                                       2.7 MB/s | 2.7 kB     00:00    
Metadata cache created.

3、查看两个库的状态
[root@localhost yum.repos.d]# yum repolist all
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:17 ago on Wed 03 Feb 2021 09:38:54 PM EST.
repo id                                repo name                               status
Appstream                              AppStream                               enabled: 4,672
BAseOS                                 BaseOS                                  enabled: 1,658

4、重新尝试安装http,内容过多,已做部分删除
[root@localhost yum.repos.d]# yum install httpd
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:34 ago on Wed 03 Feb 2021 09:38:54 PM EST.
Dependencies resolved.
=============================================================================================
 Package               Arch      Version                                  Repository    Size
=============================================================================================
Installing:
 httpd                 x86_64    2.4.37-10.module+el8+2764+7127e69e       Appstream    1.4 M
Installing dependencies:
 apr                   x86_64    1.6.3-9.el8                              Appstream    125 k
 apr-util              x86_64    1.6.1-6.el8                              Appstream    105 k
 httpd-filesystem      noarch    2.4.37-10.module+el8+2764+7127e69e       Appstream     34 k
 httpd-tools           x86_64    2.4.37-10.module+el8+2764+7127e69e       Appstream    101 k
 mod_http2             x86_64    1.11.3-1.module+el8+2443+605475b7        Appstream    156 k
 redhat-logos-httpd    noarch    80.7-1.el8                               BAseOS        25 k
Installing weak dependencies:
 apr-util-bdb          x86_64    1.6.1-6.el8                              Appstream     25 k
 apr-util-openssl      x86_64    1.6.1-6.el8                              Appstream     27 k
Enabling module streams:
 httpd                           2.4                                                        
Transaction Summary
=============================================================================================
Install  9 Packages

Complete!

**新手上路,长路漫漫。
  若有错误,敬请指教。**

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值