RHEL8 create a local YUM repository

Benefits yum yum and local benefits of this article is not to discuss the scope of this article briefly describes the new features and configuration for yum rhel8 in, in RHEL 8 is divided into two repositories:

  • BaseOS
  • Application flow (AppStream)

BaseOS package is intended to provide a core set of underlying operating system functions, provide the basis for all types of installations. Application Stream package includes a user-space application, language and runtime databases, to support various workloads and use cases.

1. Create a local yum source

You can create source repository using repo packages can also be DVD mount to a local directory.

1.1. Create a mount directory

mkdir /mnt/dvd

1.2 mount ISO files

The mount ISO file to a local mount directory / mnt / dvd in

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

ISO permanent mount package

Vim / etc / fstab 

# Add fstab file path to the package ISO

 / opt / RHEL- 8.0 - 20,181,113.1 -Server-the x86_64-dvd1.iso / mnt / DVD ISO9660 Loop 0  0

1.3 Creating repo file

Create a file called repo local.repo in /etc/yum.repos.d directory.

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

Base OS
[LocalRepo_BaseOS]
name=LocalRepo_BaseOS
baseurl=file:///mnt/dvd/BaseOS
gpgcheck=0
gpgkey=file:///mnt/dvd/BaseOS/RPM-GPG-KEY-redhat-release
enabled=1

App Stream
[LocalRepo_AppStream]
name=LocalRepository_AppStream
baseurl=file:///mnt/dvd/AppStream
enabled=1
gpgcheck=0
gpgkey=file:///mnt/dvd/AppStream/RPM-GPG-KEY-redhat-beta

Parameter Description:

[LocalRepo] # section name
name name # repository
location baseurl # package
enabled # enable repository
gpgcheck # enable secure mounting (gpgcheck is optional (if gpgcheck = 0, there is no need mentioned gpgkey)
gpgkey # key position

2. Install the package from the local yun

2.1 Clear Local Cache

[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.
0 files removed

2.2 Rebuild local cache

[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 |   0  B     00:00    
local dvd yum                                                                                                                    0.0  B/s |   0  B     00:00    
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 installation package from the local 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: 0:00:52 ago on Sat 28 Sep 2019 05:44:38 PM EDT.
Dependencies resolved.
=======================================================================================================================================================================================================================================================================
 Package                                                        Arch                                               Version                                                                           Repository                                                   Size
=======================================================================================================================================================================================================================================================================
Installing:
 httpd                                                          x86_64                                             2.4.37-10.module+el8+2764+7127e69e                                                local_appstream                                             1.4 M
Installing dependencies:
 apr                                                            x86_64                                             1.6.3-9.el8                                                                       local_appstream                                             125 k
 apr-util                                                       x86_64                                             1.6.1-6.el8                                                                       local_appstream                                             105 k
 httpd-filesystem                                               noarch                                             2.4.37-10.module+el8+2764+7127e69e                                                local_appstream                                              34 k
 httpd-tools                                                    x86_64                                             2.4.37-10.module+el8+2764+7127e69e                                                local_appstream                                             101 k
 mod_http2                                                      x86_64                                             1.11.3-1.module+el8+2443+605475b7                                                 local_appstream                                             156 k
 redhat-logos-httpd                                             noarch                                             80.7-1.el8                                                                        yum_local                                                    25 k
Installing weak dependencies:
 apr-util-bdb                                                   x86_64                                             1.6.1-6.el8                                                                       local_appstream                                              25 k
 apr-util-openssl                                               x86_64                                             1.6.1-6.el8                                                                       local_appstream                                              27 k
Enabling module streams:
 httpd                                                                                                             2.4                                                                                                                                                

Transaction Summary
=======================================================================================================================================================================================================================================================================
Install  9 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        :                                                                                                                                                                                                                                               1/1 
  Installing       : apr-1.6.3-9.el8.x86_64                                                                                                                                                                                                                        1/9 
  Running scriptlet: apr-1.6.3-9.el8.x86_64                                                                                                                                                                                                                        1/9 
  Installing       : apr-util-bdb-1.6.1-6.el8.x86_64                                                                                                                                                                                                               2/9 
  Installing       : apr-util-openssl-1.6.1-6.el8.x86_64                                                                                                                                                                                                           3/9 
  Installing       : apr-util-1.6.1-6.el8.x86_64                                                                                                                                                                                                                   4/9 
  Running scriptlet: apr-util-1.6.1-6.el8.x86_64                                                                                                                                                                                                                   4/9 
  Installing       : httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64                                                                                                                                                                                         5/9 
  Installing       : redhat-logos-httpd-80.7-1.el8.noarch                                                                                                                                                                                                          6/9 
  Running scriptlet: httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch                                                                                                                                                                                    7/9 
  Installing       : httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch                                                                                                                                                                                    7/9 
  Installing       : mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64                                                                                                                                                                                            8/9 
  Installing       : httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64                                                                                                                                                                                               9/9 
  Running scriptlet: httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64                                                                                                                                                                                               9/9 
  Verifying        : apr-1.6.3-9.el8.x86_64                                                                                                                                                                                                                        1/9 
  Verifying        : apr-util-1.6.1-6.el8.x86_64                                                                                                                                                                                                                   2/9 
  Verifying        : apr-util-bdb-1.6.1-6.el8.x86_64                                                                                                                                                                                                               3/9 
  Verifying        : apr-util-openssl-1.6.1-6.el8.x86_64                                                                                                                                                                                                           4/9 
  Verifying        : httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64                                                                                                                                                                                               5/9 
  Verifying        : httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch                                                                                                                                                                                    6/9 
  Verifying        : httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64                                                                                                                                                                                         7/9 
  Verifying        : mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64                                                                                                                                                                                            8/9 
  Verifying        : redhat-logos-httpd-80.7-1.el8.noarch                                                                                                                                                                                                          9/9 
Installed products updated.

Installed:
  httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64        apr-util-bdb-1.6.1-6.el8.x86_64                     apr-util-openssl-1.6.1-6.el8.x86_64   apr-1.6.3-9.el8.x86_64  apr-util-1.6.1-6.el8.x86_64  httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch 
  httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64  mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64  redhat-logos-httpd-80.7-1.el8.noarch 

Complete!
[root@localhost yum.repos.d]# 

Configuration is complete, any questions, please leave a message exchange!

 

Guess you like

Origin www.cnblogs.com/miaocbin/p/11606055.html