离线方式搭建本地的nginx yum源
- 手动下载安装nginx 需要的安装依赖包
登录可连接公网的一台机器, 配置 nginx.repo yum源
cat nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
执行 yum clean all && yum makecache
2. 执行 yum install --downloadonly --downloaddir=/root/nginx nginx 将安装nginx所需要的安装rpm包下载到/root/nginx目录下
下载的 rpm 安装包目录
centos-indexhtml-7-9.el7.centos.noarch.rpm nginx-1.16.1-2.el7.x86_64.rpm nginx-mod-http-perl-1.16.1-2.el7.x86_64.rpm
gd-2.0.35-26.el7.x86_64.rpm nginx-all-modules-1.16.1-2.el7.noarch.rpm nginx-mod-http-xslt-filter-1.16.1-2.el7.x86_64.rpm
gperftools-libs-2.6.1-1.el7.x86_64.rpm nginx-filesystem-1.16.1-2.el7.noarch.rpm nginx-mod-mail-1.16.1-2.el7.x86_64.rpm
libXpm-3.5.12-1.el7.x86_64.rpm nginx-mod-http-image-filter-1.16.1-2.el7.x86_64.rpm nginx-mod-stream-1.16.1-2.el7.x86_64.rpm
3. 搭建本地yum源 , 将rpm包拷贝到本地源所在的目录
centos-indexhtml-7-9.el7.centos.noarch.rpm nginx-1.16.1-2.el7.x86_64.rpm nginx-mod-http-perl-1.16.1-2.el7.x86_64.rpm gd-2.0.35-26.el7.x86_64.rpm nginx-all-modules-1.16.1-2.el7.noarch.rpm nginx-mod-http-xslt-filter-1.16.1-2.el7.x86_64.rpm gperftools-libs-2.6.1-1.el7.x86_64.rpm nginx-filesystem-1.16.1-2.el7.noarch.rpm nginx-mod-mail-1.16.1-2.el7.x86_64.rpm libXpm-3.5.12-1.el7.x86_64.rpm nginx-mod-http-image-filter-1.16.1-2.el7.x86_64.rpm nginx-mod-stream-1.16.1-2.el7.x86_64.rpm
centos-indexhtml-7-9.el7.centos.noarch.rpm nginx-1.16.1-2.el7.x86_64.rpm nginx-mod-http-perl-1.16.1-2.el7.x86_64.rpm
gd-2.0.35-26.el7.x86_64.rpm nginx-all-modules-1.16.1-2.el7.noarch.rpm nginx-mod-http-xslt-filter-1.16.1-2.el7.x86_64.rpm
gperftools-libs-2.6.1-1.el7.x86_64.rpm nginx-filesystem-1.16.1-2.el7.noarch.rpm nginx-mod-mail-1.16.1-2.el7.x86_64.rpm
libXpm-3.5.12-1.el7.x86_64.rpm nginx-mod-http-image-filter-1.16.1-2.el7.x86_64.rpm nginx-mod-stream-1.16.1-2.el7.x86_64.rp3