Fedora7 configuration use yum to use the isoDVD image source to install software
1. first, attach the CD
# The monut/dev/cdrom/mnt/cdrom disc will be mounted to/mnt/cdrom. now let's check whether the disc is mounted successfully (if this directory is not available, create it first)
# If ls/mnt/cdrom has content, the mounting is successful.
2. Understanding the truth
CentOS has two yum sources, which have two files under/etc/yum. repos. d/: CentOS-Base.repo and CentOS-Media.repo. But these two sources are not used at the same time, the default use of the Internet upgrade CentOS-Base.repo source (this file is the URL, you can look at it ), unless we manually modify the system to use the Media source, and the Media source is the local source of the computer, it contains the local CD that we just mounted.
3. start operation
First, rename the CentOS-Base.repo file so that the system can not find the file, so that you cannot use the internet update method:
# Mv CentOS-Base.repo CentOS-Base.repo.bak
Then, vi CentOS-Media.repo
Delete the last two rows of the following three rows
Baseurl = file: // media/CentOS/
File: // media/cdrom/
File: // media/cdrecorder/
The first line is changed to the path of the attached disk, as follows:
Baseurl = file: // mnt/cdrom/
Then, find this attribute and change the value to 1, so that the enable switch of the local source file is enabled.
Enabled = 0
Changed to enabled = 1
Save it.
Then, you can use yum check-update or yum install * to test whether the source is successful and effective.
========================================================== ============================
Here is a relatively lazy method.
Go to the/etc/yum. repo. d/folder.
Vi Centos-Media.repo
Change the file location in the file to/media/dvd, and open the local source, as shown below:
C5-media
Name = CentOS-$ releasever-Media
Baseurl = file: // media/dvd/
Gpgcheck = 0
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
~
You can use the local dvd as The yum source after saving and releasing it. of course, remember to put the CD in.