如何离线安装 rpm 包及其依赖项 [英] How to install a rpm package and its dependencies offline

查看:34
本文介绍了如何离线安装 rpm 包及其依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在没有 Internet 连接的 linux 服务器中安装 rpm 包(例如 python 3)及其所有依赖项.

I want to install a rpm package, (e.g. python 3), and all of its dependencies in a linux server that does not have internet connection.

我该怎么做?

推荐答案

在 CentOS/RedHat 中你可以使用 yumdownloader 获取特定的包,这会下载所有需要的 RPM,然后,压缩目录,上传到没有 Internet 访问权限的服务器并安装 RPM.

In CentOS/RedHat you can use yumdownloader for specific packages, this downloads all RPMs required, then, compress the directory, upload it to the server without Internet access and install RPMs.

这里 你可以找到示例,在没有 Internet 访问的情况下安装 Kubernetes.

Here you can find and example, installing Kubernetes without Internet access.

yumdownloader --assumeyes --destdir=/var/rpm_dir/docker-ce --resolve docker-ce
tar -czvf d4r-k8s.tar.gz /var/rpm_dir
# Upload files
scp d4r-k8s.tar.gz root@YOUR-IP:/root
# Connect to your server
ssh root@YOUR-IP
tar -xzvf /root/d4r-k8s.tar.gz -C /
# install Docker:
yum install -y --cacheonly --disablerepo=* /var/rpm_dir/docker-ce/*.rpm

这篇关于如何离线安装 rpm 包及其依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆