Question: If there is no network, how to use the Yum source.
Answer: Use CD to build Yum source
Build steps:
1. Mount CD
Mkdir/mnt/cdrom #建议挂载点
mount/dev/cdrom/mnt/cdrom/#挂载光盘
2, the network Yum source failure
Cd/etc/yum.repos.d/#进入yum源目录
MV Centos-base.repo Centos-base.repo.bak #修改yum源文件后缀名, making it ineffective
3, make the CD Yum source effective
VI Centos-media.repo
-[C6-media]
-name=centos-$releasever-media-
baseurl=file:///mnt/cdrom/ #地址为你自己的光盘挂载地址
-# file:///media/cdrom/
-# file:///media/cdrecorder/ #注释这两个不存在的地址
gpgcheck=1
enabled=0 # Change the enable=1 to enable=0 and let the Yum source configuration file take effect
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6
Actual operation:
Encountered an error:
Cannot retrieve repository metadata (Repomd.xml) for Repository:c6-media. Please verify its path and try again
Workaround:
As long as the centos-media.repo inside of the enable=1 changed to Enable=0 can be, that is, let this file invalid bar.
Run Result: