centos mirror source mount

The first step in creating a local yum source for local files

  1. Create a storage directory and mount iso directory
mkdir /mnt/iso
mkdir /mnt/cdrom
  1. The iso image files uploaded to the / mnt / iso folder (note to mount the mirror is consistent with the local system version)

  2. Iso file to mount / mnt / iso / in the / mnt / cdrom directory

mount -o loop /mnt/iso/XXXXX.iso /mnt/cdrom

<Note: After mounting the device will be prompted to complete its operation busy at this time need to mount umount unlock the job>
to see if Mount success: df -h

<System to view all mounted, mount may be>

  1. The most critical step> If /etc/yum.repos/ below * .repo other files, create folders, these * .repo first transferred to a folder, write a file .repo
mkdir /etc/yum.repos.d/bak
mv *.repo /etc/yum.repos.d/bak

Then create your own file .repo

vi myself.repo

It reads as follows:

[base]
 
name=RedHat
 
baseurl=file:///mnt/cdrom
 
enabled=1
 
gpgckeck=0
 
gpgkey=file:///mnt/cdrom/xxx
 
[base]
 name=RedHat

# Note: baseurl Here is your mounted directory, in this case / mnt / cdrom
baseurl = File:? /// mnt / cdrom
# Note: The value here must be enabled to 1?
Enabled = 1???? ??????
value gpgckeck does not matter
gpgckeck = 0

# Note: This is your cd / mnt / cdrom / can see this key, this is just an example

gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-5

  1. test:
yum clean all
yum install gcc-c++
yum install kernel-devel kernel-headers gcc make g2199746710
Published 15 original articles · won praise 0 · Views 288

Guess you like

Origin blog.csdn.net/weixin_44478009/article/details/103868768