Most of the software needed to download DVDs from CentOS7 official website, so you can configure Yum source as local DVD without network, download fast, software is stable.
1. If you are using a virtual machine, mount the DVD's ISO file in the virtual machine.
2. Create a new mount point with the following command and mount the modify Yum source configuration
mkdir /media/CentOSMount -T Auto/dev/cdrom/media/centos
You can view the mounted results by using the command mount as follows:
3. Modify the Yum source configuration to back up the Centos-base.repo files
cd/etc/Yumrepos.d/cp Centos-base.repo Centos-base.repo.bak
Modify the contents of the Centos-base.repo, annotate all mirrorlist properties in the document, open the BaseURL property annotation, and set the BaseURL property value to the mount point
baseurl=file:///media/centos/
As shown in the following:
Save, exit Edit.
4. Empty all source information that Yum already exists
Yum Clean All
5. View all software for a local source
Yum List
6. If you want to resume using the source on the network, rename the Centos-base.repo.bak again to Centos-base.repo.
7. Note that after the system restarts, you need to mount it manually again, and if necessary, you can set the/media/centos to mount automatically. A new row is added to the/etc/fstab configuration file, indicating that the/media/centos is automatically mounted. As shown below:
CentOS7 Configuring the local Yum source