我们说安装一个软件特别是编译安装的时候往往会有很多依赖,这些依赖安装往往比较麻烦,特别是在一个没有外网的环境中。有时候依赖包还存在依赖。而解决这种依赖关系就需要我们在一个配置好外网和 YUM 源的环境中使用 YUMDOWNLOADER 下载好对应的 RPM 包,然后在目标主机上进行安装。
[root@localhost ~]# yum -y install yum-utils
[root@localhost ~]# yumdownloader --resolve --destdir=/usr/local/src/ xxx --archlist=x86_64
说明:这里 XX 就是我们需要安装的包名称。
[root@localhost ~]# yum -y install yum-utils
AnolisOS-8 - PowerTools 27 kB/s | 4.3 kB 00:00
Dependencies resolved.
================================================================================================================================================
Package Architecture Version Repository Size
================================================================================================================================================
Installing:
yum-utils noarch 4.0.21-25.an8 BaseOS 75 k
Upgrading:
dnf-plugins-core noarch 4.0.21-25.an8 BaseOS 75 k
python3-dnf-plugins-core noarch 4.0.21-25.an8 BaseOS 262 k
Transaction Summary
================================================================================================================================================
Install 1 Package
Upgrade 2 Packages
Total download size: 412 k
Downloading Packages:
(1/3): yum-utils-4.0.21-25.an8.noarch.rpm 260 kB/s | 75 kB 00:00
(2/3): python3-dnf-plugins-core-4.0.21-25.an8.noarch.rpm 858 kB/s | 262 kB 00:00
(3/3): dnf-plugins-core-4.0.21-25.an8.noarch.rpm 182 kB/s | 75 kB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------
Total 990 kB/s | 412 kB 00:00
AnolisOS-8 - BaseOS 3.0 MB/s | 3.0 kB 00:00
Importing GPG key 0x4873F7C5:
Userid : "Anolis OS <os@openanolis.org>"
Fingerprint: F87D B652 2967 855E 986F 840C 6191 4008 4873 F7C5
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : python3-dnf-plugins-core-4.0.21-25.an8.noarch 1/5
Upgrading : dnf-plugins-core-4.0.21-25.an8.noarch 2/5
Installing : yum-utils-4.0.21-25.an8.noarch 3/5
Cleanup : dnf-plugins-core-4.0.21-11.an8.noarch 4/5
Cleanup : python3-dnf-plugins-core-4.0.21-11.an8.noarch 5/5
Running scriptlet: python3-dnf-plugins-core-4.0.21-11.an8.noarch 5/5
Verifying : yum-utils-4.0.21-25.an8.noarch 1/5
Verifying : dnf-plugins-core-4.0.21-25.an8.noarch 2/5
Verifying : dnf-plugins-core-4.0.21-11.an8.noarch 3/5
Verifying : python3-dnf-plugins-core-4.0.21-25.an8.noarch 4/5
Verifying : python3-dnf-plugins-core-4.0.21-11.an8.noarch 5/5
Upgraded:
dnf-plugins-core-4.0.21-25.an8.noarch python3-dnf-plugins-core-4.0.21-25.an8.noarch
Installed:
yum-utils-4.0.21-25.an8.noarch
Complete!
[root@localhost ~]#