系统相关
首页 > 系统相关> > openstack 制作离线yum源

openstack 制作离线yum源

作者:互联网

1、利用yum 安装 openstack源

[root@controller yum.repos.d]# yum install centos-release-openstack-pike 

2、此时,进入到/etc/yum.repos.d/文件夹下出现相关的包

[root@controller yum.repos.d]# pwd
/etc/yum.repos.d
[root@controller yum.repos.d]# ll
total 52
-rw-r--r--. 1 root root 2523 Jun 16  2018 CentOS-Base.repo
-rw-r--r--. 1 root root 1664 Apr 29  2018 CentOS-Base.repo_bak
-rw-r--r--. 1 root root 1056 Sep  6  2016 CentOS-Ceph-Jewel.repo
-rw-r--r--. 1 root root 1309 Nov 23  2018 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Nov 23  2018 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 Nov 23  2018 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 Nov 23  2018 CentOS-Media.repo
-rw-r--r--. 1 root root 1156 Sep 20  2017 CentOS-OpenStack-pike.repo
-rw-r--r--. 1 root root  612 Feb  1  2019 CentOS-QEMU-EV.repo
-rw-r--r--. 1 root root 1331 Nov 23  2018 CentOS-Sources.repo
-rw-r--r--. 1 root root  353 Jul 31  2018 CentOS-Storage-common.repo
-rw-r--r--. 1 root root 5701 Nov 23  2018 CentOS-Vault.repo

3、查看 Centos-Openstack-pike.repo 文件内容,定义了相关rpm包的下载路径

[root@controller yum.repos.d]# cat CentOS-OpenStack-pike.repo 
# CentOS-OpenStack-pike.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/Cloud for more
# information

[centos-openstack-pike]
name=CentOS-7 - OpenStack pike
baseurl=http://mirror.centos.org/centos/7/cloud/$basearch/openstack-pike/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
exclude=sip,PyQt4

4、查看yum的repo id号,确认openstack包的repoid

[root@controller ~]# vim /etc/yum.repos.d/CentOS-OpenStack-pike.repo 
# CentOS-OpenStack-pike.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/Cloud
 for more
# information

[centos-openstack-pike]
name=CentOS-7 - OpenStack pike
baseurl=http://mirror.centos.org/centos/7/cloud/$basearch/open
stack-pike/
gpgcheck=1
enabled=1

5、利用reposync工具同步下载包到本地,如果无reposync工具可通过 yum 安装

--repoid=           对应的包的repoid
--download_path=    存放路径
 [root@controller ~]# reposync --repoid=centos-openstack-pike --download_path=/root/pike
base                                                                   | 3.6 kB  00:00:00     
centos-ceph-jewel                                                      | 2.9 kB  00:00:00     
centos-openstack-pike                                                  | 2.9 kB  00:00:00     
centos-qemu-ev                                                         | 2.9 kB  00:00:00     
extras                                                                 | 3.4 kB  00:00:00     
updates                                                                | 3.4 kB  00:00:00     
(1/4): extras/7/x86_64/primary_db                                      | 215 kB  00:00:00     
(2/4): centos-qemu-ev/7/x86_64/primary_db                              |  65 kB  00:00:00     
(3/4): updates/7/x86_64/primary_db                                     | 7.4 MB  00:00:00 

 

标签:pike,00,centos,CentOS,离线,repo,yum,openstack,root
来源: https://www.cnblogs.com/i-10ve-cpic/p/11417907.html