YUM downloads RPM packages and related dependencies and saves them locally

Method 1: Use the yum-plugin-downloadonly plugin

A. Install the plugin

yum install yum-plugin-downloadonly -y

B. Using plugins

yum install --downloadonly --downloaddir=/tmp/rpms/maven maven
解释:yum install --downloadonly --downloaddir=相关依赖的保存路径 包名
Method 2: Use the package download tool yumdownloader provided by YUM itself

A. Installation package download tool (this tool is a subset of the YUM toolkit)

yum install yum-utils -y

B. Using tools

yumdownloader --resolve --destdir /tmp/rpms/maven maven
解释:yumdownloader --resolve --destdir 相关依赖的保存路径 包名
Method 3: Use the package download tool yumdownloader provided by YUM itself

A. Installation package download tool (this tool is a subset of the YUM toolkit)

yum install yum-utils -y

B. Using tools

repotrack --download_path=/tmp/t maven
解释:repotrack --download_path=相关依赖的保存路径 包名

the difference:

Method 1: The main software package and the dependency packages missing from the operating system of the machine based on the current RPM download will be downloaded together.
Method 2: If there is no parameter --resolve, only the main package will be downloaded, and the parameter --resolve is the same as method 1.
Method 3: This is more ruthless, and will download the full amount of dependent packages, that is to say: download the main software, the dependent packages of the main software, and the dependent packages of the dependent packages in full. Generally, the first two methods are used, and the third method is used unless the machine to be installed is quite clean.

Guess you like

Origin blog.csdn.net/goodjava2007/article/details/125489068