Linux local yum source installation (CentOS-8.3)

This installation is installed with root user privileges

Check the current system version and download the corresponding image:

cat /etc/redhat-release

The current version is 8.3.
insert image description here
Put the downloaded image into the specified folder. Make sure that the current directory has enough disk space. This time store it in the /opt directory:
insert image description here
create a directory /mnt/yumcd folder, and mount the image:

mkdir /mnt/yumcd
mount /opt/CentOS-8.3.2011-x86_64-dvd1.iso /mnt/yumcd/

Check whether the mirror is mounted:
insert image description here
enter the /etc/yum.repos.d/ directory, and edit the yum warehouse path:

cd /etc/yum.repos.d/


insert image description here
Edit the CentOS-Linux-AppStream.repo file with the command (vi: edit, q: quit, wq: save) :

vi /etc/yum.repos.d/CentOS-Linux-AppStream.repo

Comment out the mirrorlist, gpgcheck=0 to turn off gpgkey verification, enabled=1 to enable the yum warehouse:
insert image description here
edit the CentOS-Linux-BaseOS.repo file:

vi /etc/yum.repos.d/CentOS-Linux-BaseOS.repo

Comment out the mirrorlist, gpgcheck=0 to turn off gpgkey verification, enabled=1 to enable the yum warehouse:
insert image description here
edit the CentOS-Linux-Extras.repo file:

vi /etc/yum.repos.d/CentOS-Linux-Extras.repo

enabled=0 does not enable the yum repository:
insert image description here

yum clean all
yum makecache

(If the yum command does not exist, try using the dnf command, for example: dnf clean all)
insert image description here

yum repolist

insert image description here

Configure boot mount:

echo '/opt/CentOS-8.3.2011-x86_64-dvd1.iso /mnt/yumcd auto defaults 0 0' >> /etc/fstab

Check:

cat /etc/fstab

insert image description here
Restart the server, check the mount, and see the mount point, indicating that the permanent mount has been completed:
insert image description here
remove the mount:

umount /mnt/yumcd 
注释掉/etc/fstab文件中的这一行即可:
#/opt/CentOS-8.3.2011-x86_64-dvd1.iso /mnt/yumcd auto defaults 0 0

Guess you like

Origin blog.csdn.net/qq_41619841/article/details/121905496