清除原有源
yum clean all
找到挂载的驱动器
df -h
创建挂载点
mkdir /mnt/iso
挂载
mount /dev/sr0 /mnt/iso
备份原有 yum 源文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
创建本地仓库文件vi /etc/yum.repos.d/local.repo

[local]
name=Local Repository
baseurl=file:///mnt/iso
enabled=1
gpgcheck=0

sudo yum clean all
sudo yum makecache
sudo yum update