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. vue加载优化方案

    我们的项目随着组件的加入,首次加载的js文件越来越大,用户等待时间越来越长:之前想着使用webpack的splitCoding来解决,看了webpack的官方文档可以配置optimization的 m ...

  2. 利用elasticsearch-dump实现es索引数据迁移附脚本

    1.安装环境 CentOS Linux release 7.5.1804 (Core) 1 2.安装nodejs yum install -y nodejs 1 3.验证nodejs [root@lo ...

  3. P61IDEA的常用快捷键

    Alt+Enter   导入包,自动修正代码 Ctrl+Y  删除光标所在行 Ctrl+D 复制光标所在行的内容,插入光标位置下面 Ctrl+Alt+L  格式化代码 Ctrl+/   单行注释 Al ...

  4. 快速Get-JAVA-IO流

    第四阶段 IO IO流 前言: 前面的学习我们只能够在已有的一定封闭范围内进行一些操作,但是这显然是无趣的,也是不支持我们实现一些复杂的需求,所以Java提供IO流这样一种概念,方便我们对数据进行操作 ...

  5. 从 .NET 到 JavaScript —— 纯前端报表控件 ActiveReportsJS 焕新登场

    报表工具的发展史,最早可以追溯到微软报表SSRS(SQL Server Reporting Services)时期.最初,报表工具主要应用于报表的定制.呈现和输出.经过几十年的发展,随着各种业务系统功 ...

  6. LeetCode. 计数质数

    题目要求: 统计所有小于非负整数 n 的质数的数量. 示例i: 输入: 10 输出: 4 解释: 小于 10 的质数一共有 4 个, 它们是 2, 3, 5, 7 . 代码: class Soluti ...

  7. 小白学PYTHON时最容易犯的6个错误

    最近又在跟之前的同学一起学习python,一起进步,发现很多测试同学在初学python的时候很容易犯一些错误,特意总结了一下.其实这些错误不仅是在学python时会碰到,在学习其他语言的时候也同样会碰 ...

  8. python — 生成器、推导式、递归

    目录 1 生成器(函数的变异) 2 推导式 3 递归 1 生成器(函数的变异) 判断一个函数是否是生成器函数:只需看函数内部是否有yield # 生成器函数(内部是否包含yield) def func ...

  9. win10使用vnc远程到Ubuntu 19.04

    主要参考:https://www.cyberciti.biz/faq/install-and-configure-tigervnc-server-on-ubuntu-18-04/ https://ww ...

  10. 【hash表】门票

    问题 I: [哈希和哈希表]门票 题目描述 RPK要带MSH去一个更加神秘的地方!RPK带着MSH穿过广场,在第1618块砖上按下了一个按钮,在一面墙上随即出现了一个把手.RPK握住把手,打开了一扇石 ...