大网数据广告活动
服务器运维问答

Download RPM packages for command which is already installed

· 52CE 我爱测

I have a CentOS machine in which I already installed openssl-devel using $ yum install openssl-devel It downloaded and installed all the dependency packages. Now I need all those RPM packages. Is it possible to download only the …

问题原文

原帖链接 · abubacker · CC BY-SA 3.0

I have a CentOS machine in which I already installed openssl-devel using

$ yum install openssl-devel 

It downloaded and installed all the dependency packages. Now I need all those RPM packages. Is it possible to download only the RPM packages? When I do this:

 $ yum install  openssl-devel -y --downloadonly 

It says

Package 1:openssl-devel-1.0.1e-4.fc18.x86_64 already installed and latest version

since it's already installed.

Does anyone know how to download those RPM packages on the same system?

社区高分解答

原帖链接 · JohnEye · CC BY-SA 3.0

It is possible to download the packages of an RPM which is already installed using the --downloadonly switch. I am not sure why yum doesn't check this setting before checking whether the package is already installed, but I guess it could be caused by the underlying architecture of the tool.

Anyway, all you need to do is to tell yum to reinstall the package:

yum --downloadonly --downloaddir=/tmp/rpm_files/ reinstall package_name

Of course, yum will not know which dependencies were installed just for this package, so if you take the RPMs and try to install them on a different system, some dependencies might be missing. There are ways to explore the whole dependency graph and I'm sure this was already described elsewhere on SE.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-05-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。