yum只下载软件不安装的两种方法
方法1:使用yumdownloader
yumdownloade这个工具是由yum-utils这个软件安装生成的!安装好后就可以直接使用了,使用非常简单,如下:
<br />
<pre class="prettyprint linenums lang-bsh">[root@web1 ~]# rpm -qa |grep yum-utils
[root@web1 ~]# yum -y install yum-utils*
[root@web1 ~]# rpm -ql yum-utils
/usr/bin/debuginfo-install
/usr/bin/package-cleanup
/usr/bin/repo-graph
/usr/bin/repo-rss
/usr/bin/repoclosure
/usr/bin/repodiff
/usr/bin/repomanage
/usr/bin/repoquery
/usr/bin/reposync
/usr/bin/repotrack
/usr/bin/verifytree
/usr/bin/yum-builddep
/usr/bin/yum-debug-dump
/usr/bin/yum-groups-manager
/usr/bin/yumdownloader
使用非常简单,后面直接跟上包名就行了,下载好的包会保存在当前执行命令的目录下。如下:
<br />
<pre class="prettyprint linenums lang-bsh">[root@web1 ~]# ls
sys_init.sh
[root@web1 ~]# yumdownloader vlock
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.centos.org
* base: mirrors.btte.net
* extras: mirrors.btte.net
* updates: mirrors.btte.net
vlock-1.3-23.i386.rpm | 11 kB 00:00
[root@web1 ~]# ls
sys_init.sh vlock-1.3-23.i386.rpm
方法2:yum-downloadonly插件
可以直接使用yum安装该插件:
<br />
<pre class="prettyprint linenums lang-bsh">[root@web1 ~]# yum -y install yum-downloadonly
[root@web1 ~]# rpm -q yum-downloadonly
yum-downloadonly-1.1.16-21.el5.centos
如果不是特别精简的系统,默认在centos下一般都有该插件。使用时可以使用downloaddir指定下载后包存放的位置:
<br />
<pre class="prettyprint linenums lang-bsh">[root@web1 ~]# yum -y install --downloadonly --downloaddir=/tmp/ vlock
[root@web1 ~]# ll /tmp/
total 12
-rw-r--r-- 1 root root 11182 Nov 19 2007 vlock-1.3-23.i386.rpm
--downloadonly 说明只下载
--downloaddir 指定安装到哪个目录下!!
<br />
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/yum-download-only/4910.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.