mikadonic-自动创建挂载本地YUM镜像

mkdir /mnt/cdrom
mount /dev/sr0 /mnt/cdrom
echo "[local]" >>/etc/yum.repos.d/local.repo
echo "name=local" >>/etc/yum.repos.d/local.repo
echo "baseurl=file:///mnt/cdrom" >>/etc/yum.repos.d/local.repo
echo "gpgcheck=0" >>/etc/yum.repos.d/local.repo
echo "enabled=1" >>/etc/yum.repos.d/local.repo
yum clean all&&yum makecache

posted @ 2018-04-11 14:17  mikadonic  阅读(150)  评论(0编辑  收藏  举报