**
不联网本地yum源的安装。基于centos6.5版本
**
一、 把线上yum源添加到本地。
1、 打开yum的缓存
Vim /etc/yum.conf
Keepchace=1 //(开启缓存)
2、 在线下载安装 yum -y install + 需要安装的rpm包
3、 若是出现Another app is currently holding the yum lock; waiting for it to exit…
The other application is: yum
Memory : 53 M RSS (349 MB VSZ)
Started: Sat Feb 8 16:~ 此类情况则强制关闭yum进程。(chtr c/z,结束进程)
rm -f /var/run/yum.pid
再重新安装。
二、 把/var/cache/yum/x86_64/6目录下的,需要的rpm文件通过命令复制到所需的路劲,这里是复制 到/opt/nginx:
find ./ -name “*.rpm” -exec cp -r {} /opt/nginx ;(反斜杆和;结尾,才会执行成功)
find ./ -name "*.rpm"找到当前目录下所有的rpm文件
exce执行后面的操作
复制到/opt/nginx下面。
三、 用createrepo创建本地yum源
1、cd /opt/nginx 进入到保存的目录下
createrepo ./ 把当前目录下的资源打包层yum源(若是没有此命令,安装 yum -y install createrepo)
cd …