共计 2085 个字符,预计需要花费 6 分钟才能阅读完成。
某些状况下因为某些起因服务器无法访问互联网。此时就须要进行离线装置, 首先咱们须要在能够上网的服务器上将须要装置软件的 rpm 离线包下载下来, 而后去不能上网的服务器上安装。以下是几种下载的办法.
查看依赖包
> yum deplist nginx
package: nginx.x86_64 1:1.20.1-1.el7.ngx
dependency: /bin/sh
provider: bash.x86_64 4.2.46-34.el7
dependency: libc.so.6(GLIBC_2.17)(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libcrypt.so.1()(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libcrypt.so.1(GLIBC_2.2.5)(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libcrypto.so.10()(64bit)
provider: openssl-libs.x86_64 1:1.0.2k-21.el7_9
dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
provider: openssl-libs.x86_64 1:1.0.2k-21.el7_9
dependency: libcrypto.so.10(libcrypto.so.10)(64bit)
provider: openssl-libs.x86_64 1:1.0.2k-21.el7_9
dependency: libdl.so.2()(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libdl.so.2(GLIBC_2.2.5)(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libpcre.so.1()(64bit)
provider: pcre.x86_64 8.32-17.el7
dependency: libpthread.so.0()(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libpthread.so.0(GLIBC_2.2.5)(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libpthread.so.0(GLIBC_2.3.2)(64bit)
provider: glibc.x86_64 2.17-324.el7_9
dependency: libssl.so.10()(64bit)
provider: openssl-libs.x86_64 1:1.0.2k-21.el7_9
dependency: libssl.so.10(libssl.so.10)(64bit)
provider: openssl-libs.x86_64 1:1.0.2k-21.el7_9
dependency: libz.so.1()(64bit)
provider: zlib.x86_64 1.2.7-19.el7_9
dependency: openssl >= 1.0.2
provider: openssl.x86_64 1:1.0.2k-21.el7_9
dependency: rtld(GNU_HASH)
provider: glibc.x86_64 2.17-324.el7_9
provider: glibc.i686 2.17-324.el7_9
dependency: shadow-utils
provider: shadow-utils.x86_64 2:4.6-5.el7
dependency: systemd
provider: systemd.x86_64 219-78.el7_9.3
办法一: 应用 repotrack 下载 nginx rpm 装置所须要的所有依赖
> yum install yum-utils -y
// 下载 nginx 全量依赖包
> repotrack nginx
办法二: 应用 yumdownloader 下载
> yum install yum-utils -y
> yumdownloader --resolve --destdir=. nginx
- –destdir:指定 rpm 包下载目录(不指定时,默认为当前目录)
- –resolve:下载依赖的 rpm 包。
办法三:yum 的 downloadonly 插件
> yum install yum-download -y
> yum -y install nginx --downloadonly --downloaddir=.
与 yumdownloader 命令一样,也是仅会将主软件包和基于你当初的操作系统所短少的依赖关系包一并下载。
离线装置 rpm
> rpm -Uvh --force --nodeps *.rpm
原文链接:https://rumenz.com/rumenbiji/…
微信公众号: 入门小站
正文完