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
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.
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