我们想要ansible
在 rhel 7.6 机器上离线安装(参考 -https://www.linuxschoolonline.com/how-to-install-ansible-offline-on-centos-or-redhat/)
Ansible 需要系统满足以下先决条件
python-crypto
python-httplib
python-jinja2
python-keyczar
sshpass
所以我们通过 yum 安装所有请求的 rpm
正如我们所看到的,它失败了
Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch)
Requires: python2.7dist(pyasn1)
Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch)
Requires: python2.7dist(pycrypto) > 2.0
请注意 - 我们已注册到 redhat 7.x 存储库,但我们不确定需要从哪里获取丢失的 rpm,以及为什么 rhel 存储库不包含所有必需的 rpm?
安装所有这些必需的 rpm 有什么建议?
yum localinstall -y python-keyczar-0.71c-2.el7.noarch.rpm sshpass-1.06-2.el7.x86_64.rpm python2-crypto-2.6.1-15.el7.x86_64.rpm python-httplib2-0.9.2-1.el7.noarch.rpm python-jinja2-2.7.2-4.el7.noarch.rpm python-keyczar-0.71c-8.mga7.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Examining python-keyczar-0.71c-2.el7.noarch.rpm: python-keyczar-0.71c-2.el7.noarch
Marking python-keyczar-0.71c-2.el7.noarch.rpm to be installed
Examining sshpass-1.06-2.el7.x86_64.rpm: sshpass-1.06-2.el7.x86_64
sshpass-1.06-2.el7.x86_64.rpm: does not update installed package.
Examining python2-crypto-2.6.1-15.el7.x86_64.rpm: python2-crypto-2.6.1-15.el7.x86_64
Marking python2-crypto-2.6.1-15.el7.x86_64.rpm to be installed
Examining python-httplib2-0.9.2-1.el7.noarch.rpm: python-httplib2-0.9.2-1.el7.noarch
Marking python-httplib2-0.9.2-1.el7.noarch.rpm as an update to python-httplib2-0.9.1-2.1.el7.noarch
Examining python-jinja2-2.7.2-4.el7.noarch.rpm: python-jinja2-2.7.2-4.el7.noarch
Marking python-jinja2-2.7.2-4.el7.noarch.rpm as an update to python-jinja2-2.7.2-3.el7_6.noarch
Examining python-keyczar-0.71c-8.mga7.noarch.rpm: python-keyczar-0.71c-8.mga7.noarch
Marking python-keyczar-0.71c-8.mga7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package python-httplib2.noarch 0:0.9.1-2.1.el7 will be updated
---> Package python-httplib2.noarch 0:0.9.2-1.el7 will be an update
---> Package python-jinja2.noarch 0:2.7.2-3.el7_6 will be updated
---> Package python-jinja2.noarch 0:2.7.2-4.el7 will be an update
---> Package python-keyczar.noarch 0:0.71c-2.el7 will be installed
---> Package python-keyczar.noarch 0:0.71c-8.mga7 will be installed
--> Processing Dependency: python2.7dist(pycrypto) > 2.0 for package: python-keyczar-0.71c-8.mga7.noarch
--> Processing Dependency: python2.7dist(pyasn1) for package: python-keyczar-0.71c-8.mga7.noarch
---> Package python2-crypto.x86_64 0:2.6.1-15.el7 will be installed
--> Processing Dependency: libtomcrypt.so.0()(64bit) for package: python2-crypto-2.6.1-15.el7.x86_64
--> Running transaction check
---> Package libtomcrypt.x86_64 0:1.17-26.el7 will be installed
--> Processing Dependency: libtommath >= 0.42.0 for package: libtomcrypt-1.17-26.el7.x86_64
--> Processing Dependency: libtommath.so.0()(64bit) for package: libtomcrypt-1.17-26.el7.x86_64
---> Package python-keyczar.noarch 0:0.71c-8.mga7 will be installed
--> Processing Dependency: python2.7dist(pycrypto) > 2.0 for package: python-keyczar-0.71c-8.mga7.noarch
--> Processing Dependency: python2.7dist(pyasn1) for package: python-keyczar-0.71c-8.mga7.noarch
--> Running transaction check
---> Package libtommath.x86_64 0:0.42.0-6.el7 will be installed
---> Package python-keyczar.noarch 0:0.71c-8.mga7 will be installed
--> Processing Dependency: python2.7dist(pycrypto) > 2.0 for package: python-keyczar-0.71c-8.mga7.noarch
--> Processing Dependency: python2.7dist(pyasn1) for package: python-keyczar-0.71c-8.mga7.noarch
--> Finished Dependency Resolution
Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch)
Requires: python2.7dist(pyasn1)
Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch)
Requires: python2.7dist(pycrypto) > 2.0
**********************************************************************
yum can be configured to try to resolve such errors by temporarily enabling
disabled repos and searching for missing dependencies.
To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
**********************************************************************
答案1
您正在尝试安装两个版本的python-keyczar
,其中一个用于 Mageia;这就是破坏交易的原因。
一般来说,要弄清楚离线安装需要哪些软件包,您应该从基线开始,并且跑步
sudo yum install --downloadonly --downloaddir=<directory> <package>
这会将所有必需的包下载到指定目录。
在 Ansible 的例子中,你会遵循RHEL 7 的安装说明:
sudo subscription-manager repos --enable rhel-7-server-ansible-2.9-rpms
mkdir /tmp/ansible-packages
sudo yum install --downloadonly --downloaddir=/tmp/ansible-packages ansible
这会将所有要求下载到/tmp/ansible-packages
.然后,您可以将软件包复制到其他系统(假设您的 RHEL 订阅中有适当数量的单元)并使用yum localinstall
.