有些安装收到网络隔离(申请一个到DMZ区的通行证很困难)
使用yum的命令工具,在有网络环境下同步我们的yum仓库,并用http服务器代理和制作repo源进行内部安装。
实操:
[root@master openshift-cluster]# yum repolist Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. repo id repo name status epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,068 repo id 是一个重要资源,告诉我们从哪里下载从哪里出发。
[root@master openshift-cluster]# reposync -n --repoid=epel -p /data/website/epel/ (1/13068): 0ad-0.0.22-1.el7.x86_64.rpm | 3.7 MB 00:01:09 为了演示只下载一个包,太大了
创建索引 格式:createrepo -po 源目录 索引元数据的输出位置目录 [root@master openshift-cluster]# createrepo -po /data/website/epel/ /data/website/epel/ Spawning worker 0 with 3 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete [root@master repodata]# ll total 36 -rw-r--r--. 1 root root 2450 Apr 22 16:56 132e1dda94942b65444b325297a84e60828577a741eaee89fd441a4019b78ea2-other.sqlite.bz2 -rw-r--r--. 1 root root 2418 Apr 22 16:56 3dcc3d3ac375a3f3a1b0c3884649678fde896045aecbc1224ddc53f2f9bab95b-filelists.xml.gz -rw-r--r--. 1 root root 5212 Apr 22 16:56 70a98e9abd6ab3ff7d673d73bd056de8de6cb6bf9bb22bf41a7817c6cadd12b7-filelists.sqlite.bz2 -rw-r--r--. 1 root root 3173 Apr 22 16:56 9f67937fbd7a447f24a0415984147d7ca2cd6c05d69a313f4d74476c48a3e4a5-primary.xml.gz -rw-r--r--. 1 root root 6789 Apr 22 16:56 c15f2cdb47101353c0e56d9e5b0e6d2bb1c6ac31c0e847813f9db252b3280f5b-primary.sqlite.bz2 -rw-r--r--. 1 root root 1393 Apr 22 16:56 f0f21a5e74a03c372c00dcc1a75cb70e25d4a6f590d31fa4716c262749876e80-other.xml.gz -rw-r--r--. 1 root root 2974 Apr 22 16:56 repomd.xml
创建组文件的索引 说明:yum groupinstall的时候会用到这个索引。 wget http://mirrors.163.com/centos/6/base6/repodata/43d8fd068164b0f042845474d6a22262798b9f0d1f49ad1bf9f95b953089777d-c6-x86_64-comps.xml -P /tmp wget http://mirrors.163.com/centos/7/base7/repodata/38b60f66d52704cffb8696750b2b6552438c1ace283bc2cf22408b0ba0e4cbfa-c7-x86_64-comps.xml -P /tmp createrepo -g /tmp/43d*-comps.xml /data/website/centos/6/base6/ createrepo -g /tmp/38b*-comps.xml /data/website/centos/7/base7/ 下载KEY文件 用户下载安装这个RPM包时,引入RH官方的这个RPM GPG公钥,用来验证RPM包是不是RH官方签名的 wget http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7 -P /data/website/centos/ wget http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6 -P /data/website/centos/