yum 的好处及本地yum的好处不在本文讨论范畴,本文针对rhel8中的新功能yum做简要介绍和配置,在 RHEL 8中分为两个存储库:

  • BaseOS
  • 应用程序流(AppStream)

BaseOS中的软件包旨在提供底层操作系统功能的核心集,为所有类型的安装提供基础。Application Stream中的包包括用户空间应用程序,运行时语言和数据库,以支持各种工作负载和用例。

1.创建本地yum源

可以使用repo包创建存储库的源,也可以将DVD mount 到本地目录。

1.1. 创建挂载目录

mkdir /mnt/dvd

1.2 挂载ISO文件

将本地ISO文件挂载到挂载目录/mnt/dvd中

mount /opt/RHEL-8.0-20181113.1-Server-x86_64-dvd1.iso /mnt/dvd/

永久挂载ISO包

vim /etc/fstab 

# 添加ISO包路径到fstab 文件

/opt/RHEL-8.0-20181113.1-Server-x86_64-dvd1.iso /mnt/dvd iso9660 loop  

1.3 创建repo文件

在/etc/yum.repos.d目录下创建一个名为local.repo的repo文件。

vi /etc/yum.repos.d/local.repo

Base OS
[LocalRepo_BaseOS]
name=LocalRepo_BaseOS
baseurl=file:///mnt/dvd/BaseOS
gpgcheck=
gpgkey=file:///mnt/dvd/BaseOS/RPM-GPG-KEY-redhat-release
enabled= App Stream
[LocalRepo_AppStream]
name=LocalRepository_AppStream
baseurl=file:///mnt/dvd/AppStream
enabled=
gpgcheck=
gpgkey=file:///mnt/dvd/AppStream/RPM-GPG-KEY-redhat-beta

参数说明:

[LocalRepo]  # 该部分的名称
name       # 存储库的名称
baseurl         # 包裹的位置
enabled             # 启用存储库
gpgcheck          # 启用安全安装(gpgcheck是可选的(如果设置gpgcheck = 0,则无需提及gpgkey)
gpgkey              # 密钥的位置

2. 从本地yun安装软件包

2.1 清除本地缓存

[root@localhost ~]# yum clean 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.
files removed

2.2. 重建本地缓存

[root@localhost ~]# 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.
localrepository_appstream 0.0 B/s | B :
local dvd yum 0.0 B/s | B :
Failed to synchronize cache for repo 'local_appstream', ignoring this repo.
Failed to synchronize cache for repo 'yum_local', ignoring this repo.
Metadata cache created.

2.3. 从本地yum 安装软件包

[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: :: ago on Sat Sep :: PM EDT.
Dependencies resolved.
=======================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================================================================================================================
Installing:
httpd x86_64 2.4.-.module+el8++7127e69e local_appstream 1.4 M
Installing dependencies:
apr x86_64 1.6.-.el8 local_appstream k
apr-util x86_64 1.6.-.el8 local_appstream k
httpd-filesystem noarch 2.4.-.module+el8++7127e69e local_appstream k
httpd-tools x86_64 2.4.-.module+el8++7127e69e local_appstream k
mod_http2 x86_64 1.11.-.module+el8++605475b7 local_appstream k
redhat-logos-httpd noarch 80.7-.el8 yum_local k
Installing weak dependencies:
apr-util-bdb x86_64 1.6.-.el8 local_appstream k
apr-util-openssl x86_64 1.6.-.el8 local_appstream k
Enabling module streams:
httpd 2.4 Transaction Summary
=======================================================================================================================================================================================================================================================================
Install Packages Total size: 2.0 M
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : /
Installing : apr-1.6.-.el8.x86_64 /
Running scriptlet: apr-1.6.-.el8.x86_64 /
Installing : apr-util-bdb-1.6.-.el8.x86_64 /
Installing : apr-util-openssl-1.6.-.el8.x86_64 /
Installing : apr-util-1.6.-.el8.x86_64 /
Running scriptlet: apr-util-1.6.-.el8.x86_64 /
Installing : httpd-tools-2.4.-.module+el8++7127e69e.x86_64 /
Installing : redhat-logos-httpd-80.7-.el8.noarch /
Running scriptlet: httpd-filesystem-2.4.-.module+el8++7127e69e.noarch /
Installing : httpd-filesystem-2.4.-.module+el8++7127e69e.noarch /
Installing : mod_http2-1.11.-.module+el8++605475b7.x86_64 /
Installing : httpd-2.4.-.module+el8++7127e69e.x86_64 /
Running scriptlet: httpd-2.4.-.module+el8++7127e69e.x86_64 /
Verifying : apr-1.6.-.el8.x86_64 /
Verifying : apr-util-1.6.-.el8.x86_64 /
Verifying : apr-util-bdb-1.6.-.el8.x86_64 /
Verifying : apr-util-openssl-1.6.-.el8.x86_64 /
Verifying : httpd-2.4.-.module+el8++7127e69e.x86_64 /
Verifying : httpd-filesystem-2.4.-.module+el8++7127e69e.noarch /
Verifying : httpd-tools-2.4.-.module+el8++7127e69e.x86_64 /
Verifying : mod_http2-1.11.-.module+el8++605475b7.x86_64 /
Verifying : redhat-logos-httpd-80.7-.el8.noarch /
Installed products updated. Installed:
httpd-2.4.-.module+el8++7127e69e.x86_64 apr-util-bdb-1.6.-.el8.x86_64 apr-util-openssl-1.6.-.el8.x86_64 apr-1.6.-.el8.x86_64 apr-util-1.6.-.el8.x86_64 httpd-filesystem-2.4.-.module+el8++7127e69e.noarch
httpd-tools-2.4.-.module+el8++7127e69e.x86_64 mod_http2-1.11.-.module+el8++605475b7.x86_64 redhat-logos-httpd-80.7-.el8.noarch Complete!
[root@localhost yum.repos.d]#

配置完成,如有问题,请留言交流!

RHEL8 创建本地YUM存储库的更多相关文章

  1. MySQL Yum存储库 安装、升级、集群

    添加MySQL Yum存储库 首先,将MySQL Yum存储库添加到系统的存储库列表中.按着这些次序: 在http://dev.mysql.com/downloads/repo/yum/上转到MySQ ...

  2. 使用MySQL Yum存储库的快速指南【mysql官方文档】

    使用MySQL Yum存储库的快速指南 抽象 MySQL Yum存储库提供用于在Linux平台上安装MySQL服务器,客户端和其他组件的RPM包.这些软件包还可以升级和替换从Linux发行版本机软件存 ...

  3. CentOS设置yum存储库 (nginx)

    要为RHEL / CentOS设置yum存储库,请创建/etc/yum.repos.d/nginx.repo 使用以下内容命名的文件 : [nginx] name=nginx repo baseurl ...

  4. [转载]CentOS 7 创建本地YUM源

    本文中的"本地YUM源"包括三种类型:一是直接使用CentOS光盘作为本地yum源,优点是简单便捷,缺点是光盘软件包可能不完整(centos 7 Everything 总共才6.5 ...

  5. CentOS7创建本地YUM源的三种方法

    这篇文章主要介绍了CentOS7创建本地YUM源的三种方法,本文讲解了使用CentOS光盘作为本地yum源.如何为CentOS创建公共镜像.创建完全自定义的本地源等内容,需要的朋友可以参考下     ...

  6. RHEL8配置本地yum源

    在RHEL8中把软件源分成了两部分一个是BaseOS,一个是AppStream. 在Red Hat Enterprise Linux 8.0中,统一的ISO自动加载BaseOS和AppStream安装 ...

  7. CentOS7.2 创建本地YUM源和局域网YUM源

    1背景 由于开发环境只有局域网,没法使用网上的各种YUM源,来回拷贝rpm包安装麻烦,还得解决依赖问题. 想着搭建个本地/局域网YUM源,方便自己跟同事安装软件. 2环境 [root@min-base ...

  8. 创建本地yum软件源,为本地Package安装Cloudera Manager、Cloudera Hadoop及Impala做准备

    一.包管理工具及CentOS的yum 1.包管理工具如何发现可以用的包 包管理工具依赖一系列软件源,工具下载源的信息存储在配置文件中,其位置随某包管理工具不同而变化 使用yum的RedHat/Cent ...

  9. 【Asp.net入门07】第一个ASP.NET 应用程序-创建数据模型和存储库

    1.理解概念 先理解一下两个概念. 模型 模型是指数据的结构类型,以及可调用的方法.对面向对象编程方法来说,其实就是类.模型类就是一个描述数据的类.只有把数据按一定方式描述出来,我们才能在程序中方便地 ...

随机推荐

  1. POJ3311 Hie with the Pie 【状压dp/TSP问题】

    题目链接:http://poj.org/problem?id=3311 Hie with the Pie Time Limit: 2000MS   Memory Limit: 65536K Total ...

  2. 学习笔记:CentOS7学习之十八:Linux系统启动原理及故障排除

    目录 学习笔记:CentOS7学习之十八:Linux系统启动原理及故障排除 18.1 centos6系统启动过程及相关配置文件 18.1.1 centos6系统启动过程 18.1.2 centos6启 ...

  3. kafka producer 生产者客户端参数配置

    在生产者向broker发送消息时,需要配置不同的参数来确保发送成功. acks = all #指定分区中有多少副本必须收到这条消息,生产者才认为这条消息发送成功 acks = 0 #生产者发送消息之后 ...

  4. [转帖]被HTTP/2漏洞拖累,所有Kubernetes版本受影响

    被HTTP/2漏洞拖累,所有Kubernetes版本受影响 https://www.kubernetes.org.cn/5746.html 服务很重要啊... 低版本都不解决安全问题了.. 不过HTT ...

  5. (十五)springMvc 拦截器

    文章目录 定义拦截器 接口中三个方法 配置拦截器 多个拦截器的规则 定义拦截器 springMvc 中定义拦截器只需要实现一个接口 org.springframework.web.servlet.Ha ...

  6. python如何切割字符串

    python字符串的分割方法如下 str.split():字符串分割函数 通过指定分隔符对字符串进行切片,并返回分割后的字符串列表. 语法: str.split(s, num)[n] 参数说明: s: ...

  7. golang之工厂模式

    说明: golang的结构体没有构造函数,通常可以使用工厂模式来解决这个问题 如果包里面的结构体变量首字母小写,引入后,不能直接使用,可以工厂模式解决: ch1.go package ch1 type ...

  8. 训练技巧详解【含有部分代码】Bag of Tricks for Image Classification with Convolutional Neural Networks

    训练技巧详解[含有部分代码]Bag of Tricks for Image Classification with Convolutional Neural Networks 置顶 2018-12-1 ...

  9. golang代码中生成pprof和trace报告

    // 生成 CPU 报告 import ( "context" "runtime/pprof" "log" ) func cpuProfil ...

  10. python selenium2 模拟点击+拖动 测试对象 58同城验证码

    #!/usr/bin/python # -*- coding: UTF-8 -*- # @Time : 2019/12/5 17:30 # @Author : shenghao/10347899@qq ...