由于后期会需要对openstack一些项目进行打包,因此,需要不能使用在线yum源进行openstack docker镜像的制作,因此,需要自建本地离线yum源,方便后期替换rpm安装包。
环境准备:
操作系统:centos 7.6.1810
1、关闭firewalld
systemctl stop firewalld
systemctl disable firewalld
2、安装所需工具包
#同步远程repo的工具
yum install reposysc -y
#创建本地所需的工具
yum isntall createrepo -y
同步远程源
1、安装需要同步的远程repo源
一般我们同步都是同步centos的官方yum源,但是官方的源可能不在国内,因此同步速率特别慢。并且国内有一些公司,例如aliyun、网易等都会定期同步官方的源,因此,我们可以直接同步这些国内yum源,可以大大提高效率。推荐三个:
网易 mirrors.163.com
阿里云 mirrors.aliyun.com
清华 mirrors.tuna.tsinghua.edu.cn
我们本次搭建使用163做为我们同步的远程源。
安装163源参考:http://mirrors.163.com/.help/centos.html
列出本地:
yum repolist
<