1. Mount ISO. In this example, all are completed in/media.
# Cd/Media
# Mkdir ISO
# Mount-r-o loop/dev/CDROM/Media/ISO/
2. Create a repo source directory in the local file system and re-mount it to the local system.
# Cd/Media
# Mkdir Repo
# Cd Repo
# Mkdir Fedora
# Mount -- bind/Media/ISO/Fedora
3. Create a repodata data file in the local file system.
First, make sure that createrepo is installed on the system. If not, install the tool first:
# Rpm-IVH/Media/ISO/Fedora/createrepo-0.9.8-5.fc14.noarch.rpm
Create a data file:
# Cd/Media/Repo
# Createrepo-g/Media/ISO/repodata/repomd. xml ./
After createrepo is executed, a repodata directory is generated under the/Media/repo Directory, which contains the repodata data file.
4. Use the prepared ISO file.
Back up the/etc/yum. Repos. d directory and delete all files in the directory. Modify/etc/yum. Repos. d/packagekit-media.repo
[Installmedia]
Name = fedora 14
Baseurl = file: // media/Repo
Clear the previously saved cache: # Yum clean all
Now, yum can use ISO images like network resources and automatically install the RPM packages required by dependency.
Note:
For a specific system, when the ISO file is used as the yum source, the repodata must be generated by the local system. Otherwise, the source will not be available because it is inconsistent with the installation of the local RPM package.
Reference: http://www.5dlinux.com/article/1/2007/linux_8394.html