首页 > 学院 > 开发设计 > 正文

yum-本地源一键配置

2019-11-06 08:29:43
字体:
来源:转载
供稿:网友

/dev/cdrom —-本地镜像挂载路径,如果是拷贝到服务器上的需要更改路径 baseurl=file:///mnt/iso/ —–rhel5 需要添加Server 直接全量复制粘贴接口快速创建本地yum源

mkdir /mnt/isomkdir /etc/yum.repos.d/old/mv /etc/yum.repos.d/* /etc/yum.repos.d/old/touch /etc/yum.repos.d/local.repo cat >/etc/yum.repos.d/local.repo<<EOF[base]name=CentOSbaseurl=file:///mnt/iso/gpgcheck=0enabled=1EOFmount -o loop /dev/cdrom /mnt/isoyum list

附加: 如果出现下面问题需要删除 : rm /var/run/yum.pid

yum listFailed to set locale, defaulting to CLoaded plugins: PRoduct-id, security, subscription-managerUpdating Red Hat repositories.Existing lock /var/run/yum.pid: another copy is running as pid 8534.Another app is currently holding the yum lock; waiting for it to exit... The other application is: yum Memory : 34 M rss (248 MB VSZ) Started: Thu Mar 2 10:40:35 2017 - 00:06 ago State : Traced/Stopped, pid: 8534

更多相关yum 参数参考: http://www.runoob.com/linux/linux-yum.html


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表