#编写搭建本地yum仓库脚本
[root@localhost ~]# vim yum.sh
#!/bin/bash
echo "正在配置本地yum仓库..."
mkdir /mnt/centos
mount /dev/cdrom /mnt/centos &> /dev/null
echo '/dev/cdrom /mnt/centos iso9660 defaults 0 0' >> /etc/fstab
mount -a
rm -rf /etc/yum.repos.d/*
echo "[local]
name=local_centos
baseurl=file:///mnt/centos
enabled=1
gpgcheck=0" > /etc/yum.repos.d/local.repo
echo "本地yum仓库配置以完成..."
yum clean all &> /dev/null
yum repolist | tail -1
标签:centos,仓库,mnt,dev,echo,yum,本地,local From: https://blog.51cto.com/u_15457049/6636433