[CENTOS] Creating a local repository

This time, in the verification environment, create a repository in a local environment that cannot be accessed from the Internet. It will be the procedure to go.

big -When installing directly from the ISO file package -When copying and installing the ISO file package locally I will describe them separately.

Common subject matter

① Deploy virtual machine

First, configure the virtual hardware settings for the virtual machine. -Log in to the deployment destination ESXi. -Store the ISO file in any location from Storage> Datastore> Datastore Browser. -From the creation / registration of the virtual machine, set the following and complete. ● Selection of creation type -Create a new virtual machine ● Name and guest OS selection ・ The name is CentOS7 (optional) · Compatibility is ESXi 6.x virtual machine -Guest OS family is linux, guest OS version is CentOS 7 (64-bit) ● Storage selection -Select any data store ● Customize settings ・ CPU / memory / hard disk / network adapter is optional -Select the ISO file stored in any location in the data store on the CD / DVD drive 1 and select it. Put ☑ in the connection when powering on

Next, start the virtual machine and install the OS. The installation settings are optional, but the software selection chooses a minimal installation. After installation, reboot.

When installing directly from the ISO file package

① Mount ISO file, create local repository

First, configure the virtual hardware settings for the virtual machine. -From Virtual Machine> CentOS7 (optional)> Edit Settings, set the following and save. -Select the ISO file stored in any location in the data store on the CD / DVD drive 1 and select it. Put ☑ in the connection when powering on

Next, mount the ISO file. -SSH connection is made with terminal software such as TeraTerm. -Create a directory to mount.

# mkdir /mnt/cdrom

-Mount it.

# mount -t iso9660 /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only

*mount: no medium found on /dev/sr0
When * appears, CD/Check that the DVD drive is not connected.

-Check if it is mounted.

# df -h
File system size used Remaining used%Mount position
/dev/mapper/centos-root    14G  854M   14G    7% /
devtmpfs                  3.9G     0  3.9G    0% /dev
tmpfs                     3.9G     0  3.9G    0% /dev/shm
tmpfs                     3.9G  8.5M  3.9G    1% /run
tmpfs                     3.9G     0  3.9G    0% /sys/fs/cgroup
/dev/sda1                 497M  108M  390M   22% /boot
tmpfs                     799M     0  799M    0% /run/user/0
/dev/sr0                  4.1G  4.1G     0  100% /mnt/cdrom

/dev/sr0 is/mnt/Make sure it is mounted on the cdrom.

-Check the mounted directory.

# ls /mnt/cdrom/
CentOS_BuildTag  GPL       RPM-GPG-KEY-CentOS-7          images
EFI              LiveOS    RPM-GPG-KEY-CentOS-Testing-7  isolinux
EULA             Packages  TRANS.TBL                     repodata

Make sure you have Packages.

Next, we will create a local repository. -Check the directory where the repository files are stored.

# ls /etc/yum.repos.d/
CentOS-Base.repo       CentOS-Media.repo    CentOS-fasttrack.repo
CentOS-CR.repo         CentOS-Sources.repo
CentOS-Debuginfo.repo  CentOS-Vault.repo

-Create a local repository file.

# vi /etc/yum.repos.d/local.repo
[local]
enabled=1
name=localrepo
gpgcheck=0
baseurl=file:///mnt/cdrom

The destination is/mnt/The directory where you mounted the ISO file on the cdrom.

-Clear the cache etc. in yum.

# yum clean all
Loaded plugin:fastestmirror
Cleaning the repository: base extras local updates
Cleaning up everything

-Read the local repository.

# yum --disablerepo=* --enablerepo=local repolist
Loaded plugin:fastestmirror
local                                                    | 3.6 kB     00:00
(1/2): local/group_gz                                      | 155 kB   00:00
(2/2): local/primary_db                                    | 2.8 MB   00:00
Determining fastest mirrors
Repository ID Repository name Status
local                                   localrepo                          3,723
repolist: 3,723

② Install and unmount the package -Install any package.

# yum --disablerepo=* --enablerepo=local install createrepo
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
Resolving dependencies
-->Performing transaction confirmation.
--->Package createrepo.noarch 0:0.9.9-23.install el7
-->I'm dealing with dependencies: python-deltarpm package: createrepo-0.9.9-23.el7.noarch
-->I'm dealing with dependencies: libxml2-python package: createrepo-0.9.9-23.el7.noarch
-->I'm dealing with dependencies:deltarpm package: createrepo-0.9.9-23.el7.noarch
-->Performing transaction confirmation.
--->Package deltarpm.x86_64 0:3.6-3.install el7
--->Package libxml2-python.x86_64 0:2.9.1-5.el7_1.Install 2
--->Package python-deltarpm.x86_64 0:3.6-3.install el7
-->Dependency resolution finished.

Resolved the dependency

================================================================================
Package architecture
Version repository capacity
================================================================================
During installation:
 createrepo             noarch        0.9.9-23.el7           local         92 k
Dependency related installation:
 deltarpm               x86_64        3.6-3.el7              local         82 k
 libxml2-python         x86_64        2.9.1-5.el7_1.2        local        244 k
 python-deltarpm        x86_64        3.6-3.el7              local         31 k

Transaction summary
================================================================================
Installation 1 package(+Package of 3 dependencies)

Total download capacity: 449 k
Installation capacity: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------
9 in total.7 MB/s | 449 kB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
During installation: deltarpm-3.6-3.el7.x86_64                       1/4
During installation: python-deltarpm-3.6-3.el7.x86_64                2/4
During installation: libxml2-python-2.9.1-5.el7_1.2.x86_64           3/4
During installation: createrepo-0.9.9-23.el7.noarch                  4/4
During verification: deltarpm-3.6-3.el7.x86_64                       1/4
During verification: libxml2-python-2.9.1-5.el7_1.2.x86_64           2/4
During verification: python-deltarpm-3.6-3.el7.x86_64                3/4
During verification: createrepo-0.9.9-23.el7.noarch                  4/4

Installation:
  createrepo.noarch 0:0.9.9-23.el7

Installed dependency related:
  deltarpm.x86_64 0:3.6-3.el7          libxml2-python.x86_64 0:2.9.1-5.el7_1.2
  python-deltarpm.x86_64 0:3.6-3.el7

Has completed!

-Unmount any package after installing it.

# umount /mnt/cdrom/

Switch to the WebUI of the deployment destination ESXi and select Virtual Machine> CentOS7 (optional)> Edit Settings. Set the following and save. -Change CD / DVD drive 1 to host device ・ Disconnect ☑ from the connection

When copying and installing the ISO file package locally

① Mount ISO file, create local repository

First, configure the virtual hardware settings for the virtual machine. -From Virtual Machine> CentOS7 (optional)> Edit Settings, set the following and save. -Select the ISO file stored in any location in the data store on the CD / DVD drive 1 and select it. Put ☑ in the connection when powering on

Next, mount the ISO file. -SSH connection is made with terminal software such as TeraTerm. -Create a directory to mount.

# mkdir /mnt/cdrom

-Mount it.

# mount -t iso9660 /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only

*mount: no medium found on /dev/sr0
When * appears, CD/Check that the DVD drive is not connected.

-Check if it is mounted.

# df -h
File system size used Remaining used%Mount position
/dev/mapper/centos-root    14G  854M   14G    7% /
devtmpfs                  3.9G     0  3.9G    0% /dev
tmpfs                     3.9G     0  3.9G    0% /dev/shm
tmpfs                     3.9G  8.5M  3.9G    1% /run
tmpfs                     3.9G     0  3.9G    0% /sys/fs/cgroup
/dev/sda1                 497M  108M  390M   22% /boot
tmpfs                     799M     0  799M    0% /run/user/0
/dev/sr0                  4.1G  4.1G     0  100% /mnt/cdrom

/dev/sr0 is/mnt/Make sure it is mounted on the cdrom.

-Check the mounted directory.

# ls /mnt/cdrom/
CentOS_BuildTag  GPL       RPM-GPG-KEY-CentOS-7          images
EFI              LiveOS    RPM-GPG-KEY-CentOS-Testing-7  isolinux
EULA             Packages  TRANS.TBL                     repodata

Make sure you have Packages.

-Create a copy destination directory.

# mkdir -p /tmp/CentOS7/Packages

-Copy the ISO file package locally.

cp -p /mnt/cdrom/Packages/* /tmp/CentOS7/Packages

Next, we will create a local repository. -Check the directory where the repository files are stored.

# ls /etc/yum.repos.d/
CentOS-Base.repo       CentOS-Media.repo    CentOS-fasttrack.repo
CentOS-CR.repo         CentOS-Sources.repo
CentOS-Debuginfo.repo  CentOS-Vault.repo

-Create a local repository file.

# vi /etc/yum.repos.d/local.repo
[local]
enabled=1
name=localrepo
gpgcheck=0
baseurl=file:///mnt/cdrom

The destination is/mnt/The directory where you mounted the ISO file on the cdrom.

-Clear the cache etc. in yum.

# yum clean all
Loaded plugin:fastestmirror
Cleaning the repository: base extras local updates
Cleaning up everything

-Read the local repository.

# yum --disablerepo=* --enablerepo=local repolist
Loaded plugin:fastestmirror
local                                                    | 3.6 kB     00:00
(1/2): local/group_gz                                      | 155 kB   00:00
(2/2): local/primary_db                                    | 2.8 MB   00:00
Determining fastest mirrors
Repository ID Repository name Status
local                                   localrepo                          3,723
repolist: 3,723

② Install, unmount, and install packages of craterepo

-Install create repo.

# yum --disablerepo=* --enablerepo=local install createrepo
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
Resolving dependencies
-->Performing transaction confirmation.
--->Package createrepo.noarch 0:0.9.9-23.install el7
-->I'm dealing with dependencies: python-deltarpm package: createrepo-0.9.9-23.el7.noarch
-->I'm dealing with dependencies: libxml2-python package: createrepo-0.9.9-23.el7.noarch
-->I'm dealing with dependencies:deltarpm package: createrepo-0.9.9-23.el7.noarch
-->Performing transaction confirmation.
--->Package deltarpm.x86_64 0:3.6-3.install el7
--->Package libxml2-python.x86_64 0:2.9.1-5.el7_1.Install 2
--->Package python-deltarpm.x86_64 0:3.6-3.install el7
-->Dependency resolution finished.

Resolved the dependency

================================================================================
Package architecture
Version repository capacity
================================================================================
During installation:
 createrepo             noarch        0.9.9-23.el7           local         92 k
Dependency related installation:
 deltarpm               x86_64        3.6-3.el7              local         82 k
 libxml2-python         x86_64        2.9.1-5.el7_1.2        local        244 k
 python-deltarpm        x86_64        3.6-3.el7              local         31 k

Transaction summary
================================================================================
Installation 1 package(+Package of 3 dependencies)

Total download capacity: 449 k
Installation capacity: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------
9 in total.7 MB/s | 449 kB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
During installation: deltarpm-3.6-3.el7.x86_64                       1/4
During installation: python-deltarpm-3.6-3.el7.x86_64                2/4
During installation: libxml2-python-2.9.1-5.el7_1.2.x86_64           3/4
During installation: createrepo-0.9.9-23.el7.noarch                  4/4
During verification: deltarpm-3.6-3.el7.x86_64                       1/4
During verification: libxml2-python-2.9.1-5.el7_1.2.x86_64           2/4
During verification: python-deltarpm-3.6-3.el7.x86_64                3/4
During verification: createrepo-0.9.9-23.el7.noarch                  4/4

Installation:
  createrepo.noarch 0:0.9.9-23.el7

Installed dependency related:
  deltarpm.x86_64 0:3.6-3.el7          libxml2-python.x86_64 0:2.9.1-5.el7_1.2
  python-deltarpm.x86_64 0:3.6-3.el7

Has completed!

-Create a local repository.

# createrepo /tmp/CentOS7/
Spawning worker 0 with 1862 pkgs
Spawning worker 1 with 1861 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

-Edit the local repository file.

# vi /etc/yum.repos.d/local.repo
[local]
enabled=1
name=localrepo
gpgcheck=0
baseurl=file:///tmp/CentOS7


The destination is/tmp/In CentOS7, this is the directory where the ISO file is copied.

-Clear the cache etc. in yum.

# yum clean all
Loaded plugin:fastestmirror
Cleaning the repository: base extras local updates
Cleaning up everything

-Read the local repository.

# yum --disablerepo=* --enablerepo=local repolist
Loaded plugin:fastestmirror
local                                                    | 3.6 kB     00:00
(1/2): local/group_gz                                      | 155 kB   00:00
(2/2): local/primary_db                                    | 2.8 MB   00:00
Determining fastest mirrors
Repository ID Repository name Status
local                                   localrepo                          3,723
repolist: 3,723

-Unmount.

# umount /mnt/cdrom/

Switch to the WebUI of the deployment destination ESXi and select Virtual Machine> CentOS7 (optional)> Edit Settings. Set the following and save. -Change CD / DVD drive 1 to host device ・ Disconnect ☑ from the connection

-Install any package.

# yum --disablerepo=* --enablerepo=local install dovecot
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
Resolving dependencies
-->Performing transaction confirmation.
--->Package dovecot.x86_64 1:2.2.10-5.install el7
-->I'm dealing with dependencies: libclucene-shared.so.1()(64bit)Package: 1:dovecot-2.2.10-5.el7.x86_64
-->I'm dealing with dependencies: libclucene-core.so.1()(64bit)Package: 1:dovecot-2.2.10-5.el7.x86_64
-->Performing transaction confirmation.
--->Package clucene-core.x86_64 0:2.3.3.4-11.install el7
-->Dependency resolution finished.

Resolved the dependency

================================================================================
Package architecture
Version repository capacity
================================================================================
During installation:
 dovecot              x86_64         1:2.2.10-5.el7         local         3.2 M
Dependency related installation:
 clucene-core         x86_64         2.3.3.4-11.el7         local         528 k

Transaction summary
================================================================================
Installation 1 package(+1 dependency package)

Total download capacity: 3.7 M
Installation capacity: 12 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------
Total 307 MB/s | 3.7 MB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
During installation: clucene-core-2.3.3.4-11.el7.x86_64              1/2
During installation: 1:dovecot-2.2.10-5.el7.x86_64                   2/2
During verification: clucene-core-2.3.3.4-11.el7.x86_64              1/2
During verification: 1:dovecot-2.2.10-5.el7.x86_64                   2/2

Installation:
  dovecot.x86_64 1:2.2.10-5.el7

Installed dependency related:
  clucene-core.x86_64 0:2.3.3.4-11.el7

Has completed!

Recommended Posts

Creating a local repository
Maven repository local cache
Creating a test case
Creating a common repository with Spring Data JPA
Creating a batch of Liferay
Creating a Scala custom ExecutionContext
Creating a calendar using Ruby
[Rails] Creating a search box
[Rails] Creating a new project with rails new
Creating a timer app with a muddy
Using a local network on iOS 14
Creating a project (and GitHub repository) using Java and Gradle in IntelliJ IDEA
4. Creating a manifest and running a web module
The road to creating a music game 2
[Creating] A memorandum about coding in Java
How to create a Maven repository for 2020
Creating a user authentication function using devise
Build a Maven repository on AWS S3
Creating a Servlet in the Liberty environment
Rails Basics of creating a new application
Creating a Payjp Customer and setting default_card
Creating a matrix class in Java Part 1
The road to creating a music game 3
The road to creating a music game 1