标签:centos7
mkdir /mnt/cdrom -p
mount /dev/cdrom /mnt/cdrom
echo "mount /dev/cdrom /mnt/cdrom" >>/etc/rc.local
mkdir /etc/yum.repos.d/yumbak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/yumbak
tee >>/etc/yum.repos.d/Local.repo<<-eof
[Local]
name=local_yum
baseurl=file:///mnt/cdrom
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enable=1
eof
yum clean all
yum update
yum makecache
标签:centos7
原文地址:http://9380121.blog.51cto.com/9370121/1930546