CentOS Local ISO mount and configure local software source

Source: Internet
Author: User
Tags gpg

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.