首页 > 代码库 > CentOS7本地yum源一键配置脚本

CentOS7本地yum源一键配置脚本


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本地yum源一键配置脚本