Detailed tutorial on configuring local yum source in CentOS8

Detailed tutorial on configuring local yum source in CentOS8

The centos8 distribution is released through the BaseOS and AppStream repositories. AppStream is a new extension of the traditional rpm format that provides multiple major versions of a component at the same time.

CentOS8 comes with NGINX packaged in it. This article introduces how to configure the local yum source in CentOS8. The specific contents are as follows:

1. Create a directory

mkdir /mnt/cdrom

2. Mount your cdrom file.

2.1 Optical drive method

Using the CD-ROM drive, for vmware users, you can directly use the image, as shown in the figure

insert image description here

sudo mount /dev/cdrom /mnt/cdrom

Then enter the directory. As long as the following files can be listed, it means the mount is successful.

insert image description here

2.2 Mount using iso image file

First you have to transfer the iso file to your centos, you can only think of a way here. If there is no network, use a USB drive. If there is no USB drive, use a CD-ROM drive. In short, it has to be transferred to the corresponding directory

insert image description here

Then use the mount command to mount the file. The difference is whether there is parameter -o

mount -o loop /mnt/iso/CentOS-8-x86_64-1905-dvd1.iso /mnt/cdrom

3 Enter the /etc/yum.repos.d directory

cd /etc/yum.repos.d

4. Open the CentOS-Media.repo file

sudo vi CentOS-Media.repo

The file is modified as follows, with 6 changes
baseurl , specifies the BaseOS and AppStream directories under the mounted directory
gpgcheck does not check
enabled Enable this image

insert image description here

3. Shield the default image

vim enters the following 3 files, and then changes enabled=0

insert image description here

It should look like the following, but there is a problem. If you want to install the package via the network in the future, remember to change it to 1 to re-enable it.

insert image description here

3.yum clean all

Clear the cache

sudo yum clean all

4.yum makecache

Rebuilding the cache

sudo yum makecache

5. Result Verification

Try searching for any package.

yum search openssh If there is no problem, it means the configuration is ok

insert image description here

6. Automatically hang the disk when starting up

This is to avoid the problem that the mirror source cannot be accessed after restart. We need to configure the mount operation in our /etc/fstab file

6.1 Use mount -l to view the information of the mounted disk

insert image description here

From the above, we can get 5 pieces of information

/dev/cdrom /mnt/cdrom iso9660 defaults 0 0

In fact, it can also be written like this

/dev/cdrom /mnt/cdrom autodefaults 0 0

The device name is what I linked, so I can just fill in sr0 here, but I still write /dev/cdrom

6.2 Configure information into /etc/fstab file

insert image description here

Summarize

The above is a detailed tutorial on how to configure the local yum source for CentOS8. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to configure domestic sources in CentOS8 yum/dnf
  • How to configure local YUM on CentOS 6.5
  • How to build YUM in Centos7 environment

<<:  Analysis of a MySQL deadlock scenario example

>>:  Detailed explanation of as, question mark and exclamation mark in Typescript

Recommend

Vue implements form data validation example code

Add rules to the el-form form: Define rules in da...

idea uses docker plug-in to achieve one-click automated deployment

Table of contents environment: 1. Docker enables ...

Vue easily realizes watermark effect

Preface: Use watermark effect in vue project, you...

Detailed tutorial on installing PHP and Nginx on Centos7

As the application of centos on the server side b...

How to install and use Ubuntu Docker

Table of contents 1. Automatic installation using...

HTML table markup tutorial (28): cell border color attribute BORDERCOLOR

To beautify the table, you can set different bord...

Detailed explanation of the role of brackets in AngularJS

1. The role of brackets 1.1 Square brackets [ ] W...

What are the benefits of using B+ tree as index structure in MySQL?

Preface In MySQL, both Innodb and MyIsam use B+ t...

A brief analysis of different ways to configure static IP addresses in RHEL8

While working on a Linux server, assigning static...

Detailed explanation of mysql download and installation process

1: Download MySql Official website download addre...

Teach you step by step to configure MySQL remote access

Preface When using the MySQL database, sometimes ...

Implementation of docker-compose deployment of zk+kafka+storm cluster

Cluster Deployment Overview 172.22.12.20 172.22.1...

A comprehensive analysis of what Nginx can do

Preface This article only focuses on what Nginx c...