在气垫(离线)CentOS 6系统上安装yum软件包

我有一个CentOS 6系统,出于安全考虑,它是通风的。 它可能从来没有连接到互联网,如果有,它还没有被更新很长一段时间。

我想将所有.rpm软件包放在一个驱动器上,以便在不查询networking的情况下离线安装它们。 然而,我在testing虚拟机上遇到的问题是,即使指定了本地path, yum仍然挂起并尝试从联机存储库进行更新。

另外,是否有一种方法可以轻松获取该包使用yum-utils / yumdownloader 所有依赖关系 ? 目前,它仍然遗漏了一些依赖(例如,当我拉动gcc-c ++ rpm时,它将抓取cppgcc但不会拉动cloog-pplmpfrppl

我已经尝试了这样的解决scheme ,但我不能认为已经有一个依赖树,或者yum将是最新的。

在Docker镜像的新安装中,我第一次尝试运行yum(禁用了internet)时,出现Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

如果您担心已安装的发行版和最新的stable版本之间的兼容性,则可能需要在/etc/redhat-release确定您的centos版本,并使用来自http://vault.centos.org/的软件包,但请记住,将不包含任何安全更新或错误修复。

要下载软件包 – 请使用官方的redhat教程: https : //access.redhat.com/solutions/10154

 yum install yum-plugin-downloadonly yum install --downloadonly --downloaddir=<directory> <package> 

要么

 yum install yum-utils yumdownloader --resolve 

你也可以看看在你想下载rpms的vm上复制yum历史logging的方法: https : //unix.stackexchange.com/a/83115

最简单的方法是,长时间工作是:

 yum-debug-dump => gives file. yum-debug-restore <file-from-debug-dump> 

…这很像get / set选项dpkg命令,AIUI。 另外请注意,如果您正在重放历史logging,则可以使用:

 yum history addon-info last saved_tx => gives file yum load-tx <file-from-addon-info> 

…而不必自己parsing。

编辑:

从目录安装所有rpms, cd到它,如果你想要安装它们,只需使用rpm -ivh *.rpm ,或者如果一些下载的文件比已经存在的文件更新,则使用rpm -Uvh *.rpm ,你可以更新他们。

编辑:NOPE,没有什么是容易的。 在新堆栈上仍然出现此错误: Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

如果我让yum访问互联网足够长的时间来configuration自己,下面的工作:

首先,我可以通过调用拉下所有的依赖包

yum install -y --downloadonly --downloaddir=$pkgdir <package>

yum reinstall -y --downloadonly --downloaddir=$pkgdir <package>

强制任何已经安装的软件包来提取它们的.rpm和依赖项。 然后,一旦我采购了我的包装包,我把它放在一个新的系统上。

首先,我运行了sed -i 's/enabled=1/enabled=0/' '/etc/yum/pluginconf.d/fastestmirror.conf' /'/etc/yum/pluginconf.d/fastestmirror.conf sed -i 's/enabled=1/enabled=0/' '/etc/yum/pluginconf.d/fastestmirror.conf'来禁用fastmirror插件。

然后,我可以安装所有我需要的软件包,然后小心的打包到目录中

yum install --disablerepo=\* packag*

按依赖关系所需的顺序。 所以看起来有点像

 yum install --disablerepo=\* epel* yum install --disablerepo=\* ius* yum install --disablerepo=\* libstd* yum install --disablerepo=\* mpfr* yum install --disablerepo=\* cpp* yum install --disablerepo=\* libgcc* yum install --disablerepo=\* libgomp* yum install --disablerepo=\* libg* yum install --disablerepo=\* ppl* yum install --disablerepo=\* cloog* yum install --disablerepo=\* gcc* yum install --disablerepo=\* atlas* yum install --disablerepo=\* python* 

瞧! 我能够在完全充气系统上运行python3.5。