如果某个软件从来没有安装过,现在想通过yum把它下载下来,可以这样:
# yum install perl-MailTools --downloadonly --downloaddir=/opt -y
Loading "installonlyn" plugin
Loading "downloadonly" plugin
Loading "security" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for perl-MailTools to pack into transaction set.
perl-MailTools-2.03-1.el5 100% |=========================| 11 kB 00:00
---> Package perl-MailTools.noarch 0:2.03-1.el5.rf set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
perl-MailTools noarch 2.03-1.el5.rf dag 100 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 100 k
Downloading Packages:
(1/1): perl-MailTools-2.0 100% |=========================| 100 kB 00:02
exiting because --downloadonly specified
# yum install perl-MailTools --downloadonly --downloaddir=/opt -y
Loading "installonlyn" plugin
Loading "downloadonly" plugin
Loading "security" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for perl-MailTools to pack into transaction set.
perl-MailTools-2.03-1.el5 100% |=========================| 11 kB 00:00
---> Package perl-MailTools.noarch 0:2.03-1.el5.rf set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
perl-MailTools noarch 2.03-1.el5.rf dag 100 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 100 k
Downloading Packages:
(1/1): perl-MailTools-2.0 100% |=========================| 100 kB 00:02
exiting because --downloadonly specified