CentOS8 detailed tutorial for configuring local yum source

The centos8 release is released through the BaseOS and AppStream (AppStream) warehouses. AppStream is a new extension to the traditional rpm format, providing multiple major versions for a component at the same time

Centos8 comes with NGINX encapsulated. This article introduces CentOS8 to configure local yum sources. The specific content is as follows:

1. Create a directory

mkdir /mnt/cdrom

**2. Mount your cdrom file. **

2.1 Optical drive

Using CD-ROM, for vmware users, mirroring can be used directly, as shown in the figure

sudo mount /dev/cdrom /mnt/cdrom

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

2.2 Mount with iso image file

First of all, you have to upload the iso file to your centos, here you can only think of a way. Use a USB flash drive without a network, and a CD-ROM drive without a USB flash drive In short, it has to be transferred to the corresponding directory

Then use the mount command to mount the file. The difference is whether there is a 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

  1. Open the CentOS-Media.repo file

sudo vi CentOS-Media.repo

The file is modified as follows, and there are 6 modifications
baseurl, specify the BaseOS and AppStream directories under the mounted directory
gpgcheck does not check
enabled Enable the mirror

3. Block the default mirror

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

Probably as shown below, but there is a problem. If you want to install the package through the network in the future, remember to re-enable it by changing it to 1 again.

  1. yum clean all

Clear cache

sudo yum clean all

4. yum makecache

Rebuild cache

sudo yum makecache

5. Result verification

Just search for a package and try.

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

6. Automatically hang disk after boot

In order to avoid the problem that the mirror source cannot be accessed after restarting. We need to configure the mounting operation in our /etc/fstab file

6.1 Use mount -l to view the information of the disk we hung

5 information can be obtained from the above

/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 the one I have linked, so I can fill in sr0 here, but I still write /dev/cdrom

6.2 Configure the information in the /etc/fstab file

to sum up

The above is a detailed tutorial for configuring local yum sources on CentOS8 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Recommended Posts

CentOS8 detailed tutorial for configuring local yum source
CentOS 5 to CentOS 5.8 YUM source
The tutorial for upgrading from Centos7 to Centos8 (detailed graphic)
vmware install CentOS 7 detailed tutorial
CentOS 7 yum install PHP7.3 tutorial
CentOS 8 installation of MariaDB detailed tutorial
CentOS8.1 build Gitlab server detailed tutorial
CentOS6 minimal installation KVM detailed tutorial
Centos8 installation diagram (super detailed tutorial)
Centos8 uses Docker to deploy a detailed tutorial for Django projects
Tutorial diagram for installing zabbix2.4 under centos6.5
CentOS 6 add common yum source to transfer
Detailed tutorial for installing CUDA9.0 on Ubuntu 16.04
Graphical tutorial for installing JDK1.8 under CentOS7.4
Detailed tutorial for installing phpMyAdmin on Ubuntu 18.04
Detailed tutorial on installing MySQL 8 in CentOS 7
Centos8 use yum to install rabbitmq tutorial
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
Centos7 installation of PHP and Nginx tutorial detailed
Build LEMP (Linux+Nginx+MySQL+PHP) environment under CentOS 8.1 (detailed tutorial)
Detailed tutorial of installing nginx on centos8 (graphic)
Tutorial for deploying nginx+uwsgi in django project under Centos8
Detailed explanation of CentOS7 network setting tutorial in vmware
Detailed tutorial on installing JDK8 on Linux system (CentOS7 installation)