码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS7本地yum源一键配置脚本

时间:2017-05-30 13:24:13      阅读:152      评论:0      收藏:0      [点我收藏+]

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

标签:centos7

原文地址:http://9380121.blog.51cto.com/9370121/1930546

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!