In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to download RPM package without installing it with yum command in CentOS". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Yum is the default package manager on Red Hat-based systems such as CentOS, Fedora, RHEl. With yum, you can install or update a RPM package, and it will automatically resolve package dependencies. But what if you just want to download a RPM package to your system? For example, you may want to get some RPM packages for later use, or install them on another machine.
Here is how to download a RPM package from the yum repository.
Method 1: yum
The yum command itself can be used to download a RPM package, and the standard yum command provides the option-- downloadonly (download only) to do this.
The code is as follows:
$sudo yum install-downloadonly
By default, a downloaded RPM package is saved in the following directory:
The code is as follows:
/ var/cache/yum/x86_64/ [centos / fedora-version] / [repository] / packages
The [repository] above indicates the name of the source repository where the package was downloaded (for example: base, fedora, updates)
If you want to download a package to a specified directory (such as / tmp):
The code is as follows:
$sudo yum install-downloadonly-downloaddir=/tmp
Note that if the downloaded package contains any unsatisfied dependencies, yum will download all dependency packages, but none of them will be installed.
Another important thing is that in CentOS/RHEL 6 or earlier, you need to install a separate yum plug-in (named yum-plugin-downloadonly) to use the-- downloadonly command option:
The code is as follows:
$sudo yum install yum-plugin-downloadonly
Without the plug-in, you will get the following error when using yum:
The code is as follows:
Command line error: no such option:-- downloadonly
Method 2: Yumdownloader
Another way to download RPM packages is through a special package download tool, yumdownloader. This tool is a subset of the yum toolkit, which contains a suite of help tools for managing yum packages.
The code is as follows:
$sudo yum install yum-utils
Download a RPM package:
The code is as follows:
$sudo yumdownloader
The downloaded package is saved in the current directory. You need to use root permissions because yumdownloader updates the package index file during the download process. Unlike the yum command, any dependent packages will not be downloaded.
This is the end of "how to download the RPM package without installing it with the yum command in CentOS". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.