yum-本地源一键配置

来源:互联网 发布:java线程池 callable 编辑:程序博客网 时间:2024/06/05 16:58

/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

0 0