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
Two, view mount status
[[email protected] ~ ]# df -hfilesystem size used avail use% mounted on/dev/mapper/ volgroup00-logvol00 19g 3.3g 15g 19% / /dev/sda1 99m 12M 82M 13% /boottmpfs 62M 0 62M 0% /dev/shm/mnt/iso/CentOS5.iso 3.9G 3.9G 0 100% /mnt/cdrom[[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-mediabaseurl=file:///mnt/#表明yum源在/mnt Directory, other sources (BaseURL) commented out #baseurl =file:///media/centos/# file:///media/cdrom/# file:///media/cdrecorder/gpgcheck=1enabled=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 1label=/boot /boot ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gid=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /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 sources