CentOS mount ISO image file as local source
Operating system: CentOS5.5
ISO file: ISO image for CentOS5.5 one
Operation Steps:
One, mount the ISO file to the mount point
[Email protected] ~]# mount-o loop/mnt/iso/centos5.iso/mnt/cdrom
Second, view the Mount status
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/volgroup00-logvol00
19G 3.3G 15G 19%/
/DEV/SDA1 99M 12M 82M 13%/boot
Tmpfs 62M 0 62M 0%/dev/shm
/mnt/iso/centos5.iso 3.9G 3.9G 0 100%/mnt/cdrom
To mount the system partition again
[Email protected] ~]# mount-a
Third, modify the Yum configuration file, use the local ISO to do yum source
# cd/etc/yum.repos.d/
# MV Centos-base.repo Centos-base.repo.bak
# CP Centos-media.repo Centos-media.repo.bak
# Cat Centos-media.repo
[C5-media]
name=centos-$releasever-media
baseurl=file:///mnt/#表明yum源在/mnt Directory, other sources (BaseURL) are commented out
#baseurl =file:///media/centos/
# file:///media/cdrom/
# file:///media/cdrecorder/
Gpgcheck=1
Enabled=1 #启用yum
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
Four, clear the cache
# Yum Clean All
# Yum List
Five, test:
To install Telnet:
#yum Install telnet*
Six, boot automatically mount ISO image file
In the/etc/fstab table, add the last row to permanently mount the ISO file to the system
[Email protected] ~]# Cat/etc/fstab
/DEV/VOLGROUP00/LOGVOL00/EXT3 Defaults 1 1
Label=/boot/boot ext3 Defaults 1 2
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
/DEV/VOLGROUP00/LOGVOL01 swap swap defaults 0 0
/mnt/iso/centos5.iso/mnt/cdrom iso9660 Loop 0 0
CentOS Local ISO mount and configure local software source