Configuring the Local Yum Source
- Mount the OS image.
1mount YOUR_OS.iso /media -o loop
Replace YOUR_OS.iso with the actual iso package name.
- Back up the Yum repo file and clear the /etc/yum.repos.d/ directory.
1 2
cp -r /etc/yum.repos.d /etc/yum.repos.d-bak rm /etc/yum.repos.d/*
Ensure that all repo files have been backed up. Enter y on the rm deletion page to agree to the deletion.
- Configure a local Yum source.
- Create an /etc/yum.repos.d/Local.repo file.
1vi /etc/yum.repos.d/Local.repo - Press i to enter the insert mode and add the following content to the file:
1 2 3 4 5
[Local] name=Local baseurl=file:///media/ enabled=1 gpgcheck=0
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create an /etc/yum.repos.d/Local.repo file.
- Make the Yum source configuration take effect.
1 2
yum clean all yum makecache
- Use the Yum source to install related software.
1yum -y install wget vim
Parent topic: Configuring the Compilation Environment