[[Email protected] ~] #ls/media/dvd/#查看 System CD
[[Email protected] ~] #mkdir/home/yum_packupages/centos/#创建一个存放系统光盘数据文件夹
[[Email protected] ~] #cp/media/dvd/centos/*/home/yum_packupages/centos/#复制系统光盘数据到本地
[[Email protected] ~] #cd/etc/yum.repos.d/#进入配置 Directory
[[email protected] yum.repos.d]# LS # View configuration Files
Centos-base.repo Centos-debuginfo.repo Centos-media.repo Centos-vault.repo
Centos-cr.repo Centos-fasttrack.repo Centos-sources.repo
[Email protected] yum.repos.d]# vim centos-base.repo #修改配置 File
[Base]
name=centos-$releasever-base
baseurl=file:///home/yum_packages/centos/#yum源目录, image file Directory to store
Enabled=1 #是否用该yum源, 0 is disabled, 1 is used
Gpgcheck=1 #检查GPG-key,0 for no check, 1 for inspection
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 #本地yum源密钥, Gpgcheck No configuration required when =0
[[email protected] YUM.REPOS.D] #yum list #检查 If Yum is available, a list of installation packages is available
[email protected] yum.repos.d]# Yum install ftp* #yum本 To install
CentOS Configuration local Yum source