{"id":570,"date":"2012-09-13T12:45:43","date_gmt":"2012-09-13T11:45:43","guid":{"rendered":"http:\/\/blogs.silicontechnix.com\/?p=570"},"modified":"2012-12-01T10:53:06","modified_gmt":"2012-12-01T10:53:06","slug":"how-to-download-a-rpm-package-using-yum-command-without-installing-on-linux","status":"publish","type":"post","link":"https:\/\/blogs.silicontechnix.com\/?p=570","title":{"rendered":"How To Download a RPM Package Using yum Command Without Installing On Linux"},"content":{"rendered":"<p>If you ever wanted to download the rpm package instead of installing it with yum ! you can do that with ease, that is useful when you want to keep backup of some RPMs or want to see what&#8217;s inside RPM etc.<br \/>\n<!--more--><br \/>\nSo how to download a RPM package using yum command under CentOS, Enterprise Linux server 5.x or RHEL 5.x systems (any yum supported) ?<\/p>\n<p>First you need to install plugin called &#8220;yum-downloadonly&#8221;. After installing the plugin you can use\u00a0 &#8211;downloadonly flag to yum so that yum will only download the packages and will not install\/update them. Following options supported by this plugin:<\/p>\n<pre class=\"brush:bash\">[a] --downloadonly : don't update, just download a rpm file\r\n[b] --downloaddir=\/path\/to\/dir : specifies an alternate directory to store packages such as \/tmp<\/pre>\n<p>Please note following instructions are only tested on CentOS server but should work with Fedora, RHN and RHEL without any problem.<\/p>\n<p>To install yum-downloadonly plugin:-<\/p>\n<p>Type the following command to install plugin, enter:<\/p>\n<pre class=\"brush:bash\"># yum install yum-downloadonly<\/pre>\n<p>Sample output:<\/p>\n<pre class=\"brush:bash\">Loading \"fastestmirror\" plugin\r\nLoading \"security\" plugin\r\nLoading mirror speeds from cached hostfile\r\n* base: centos.mirrors.tds.net\r\n* updates: mirror.myriadnetwork.com\r\n* addons: mirrors.gigenet.com\r\n* extras: holmes.umflint.edu\r\nSetting up Install Process\r\nParsing package install arguments\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package yum-downloadonly.noarch 0:1.1.10-9.el5.centos set to be updated\r\n--&gt; Finished Dependency Resolution\r\nDependencies Resolved\r\n=============================================================================\r\nPackage Arch Version Repository Size\r\n=============================================================================\r\nInstalling:\r\nyum-downloadonly noarch 1.1.10-9.el5.centos base 9.0 k\r\nTransaction Summary\r\n=============================================================================\r\nInstall 1 Package(s)\r\nUpdate 0 Package(s)\r\nRemove 0 Package(s)\r\nTotal download size: 9.0 k\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/1): yum-downloadonly-1 100% |=========================| 9.0 kB 00:00\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\nInstalling: yum-downloadonly ######################### [1\/1]\r\nInstalled: yum-downloadonly.noarch 0:1.1.10-9.el5.centos\r\nComplete!<\/pre>\n<p>How do I download a RPM package only from RHN or CentOS mirror, without installing it?<\/p>\n<p>Download httpd package but don&#8217;t install\/update, enter:<\/p>\n<pre class=\"brush:bash\"># yum update httpd -y --downloadonly<\/pre>\n<p>By default package will by downloaded and stored in \/var\/cache\/yum\/ directory. But, you can specifies an alternate directory to store packages such as \/opt, enter:<\/p>\n<pre class=\"brush:bash\"># yum update httpd -y --downloadonly --downloaddir=\/opt<\/pre>\n<p>Sample output:<\/p>\n<pre class=\"brush:bash\">yum install httpd -y --downloadonly\r\nLoading \"downloadonly\" plugin\r\nLoading \"fastestmirror\" plugin\r\nLoading \"security\" plugin\r\nLoading mirror speeds from cached hostfile\r\n* base: centos.mirrors.mypsh.com\r\n* updates: mirror.steadfast.net\r\n* addons: mirrors.gigenet.com\r\n* extras: holmes.umflint.edu\r\nSetting up Install Process\r\nParsing package install arguments\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package httpd.i386 0:2.2.3-11.el5_1.centos.3 set to be updated\r\nfilelists.xml.gz 100% |=========================| 2.8 MB 00:03\r\nfilelists.xml.gz 100% |=========================| 681 kB 00:11\r\nfilelists.xml.gz 100% |=========================| 122 kB 00:00\r\nfilelists.xml.gz 100% |=========================| 150 B 00:00\r\n--&gt; Finished Dependency Resolution\r\nDependencies Resolved\r\n=============================================================================\r\nPackage Arch Version Repository Size\r\n=============================================================================\r\nInstalling:\r\nhttpd i386 2.2.3-11.el5_1.centos.3 base 1.1 M\r\nTransaction Summary\r\n=============================================================================\r\nInstall 1 Package(s)\r\nUpdate 0 Package(s)\r\nRemove 0 Package(s)\r\nTotal download size: 1.1 M\r\nDownloading Packages:\r\n(1\/1): httpd-2.2.3-11.el5 100% |=========================| 1.1 MB 00:01\r\nexiting because --downloadonly specified<\/pre>\n<p>To see downloaded file, enter:<\/p>\n<pre class=\"brush:bash\"># ls -l \/opt\/*.rpm<\/pre>\n<p>Sample output:<\/p>\n<pre class=\"brush:bash\">-rw-r--r-- 1 root root 1116426 Jan 17 03:36 \/opt\/httpd-2.2.3-11.el5_1.centos.3.i386.rpm\r\n-rw-r--r-- 1 root root 83452 Oct 2 2007 \/opt\/lighttpd-fastcgi-1.4.18-1.el5.rf.i386.rpm\r\n-rw-r--r-- 1 root root 635045 Oct 20 2007 \/opt\/psad-2.1-1.i386.rpm<\/pre>\n<p><strong>Method # 2: yum-utils.noarch Package<\/strong><\/p>\n<p>yum-utils is a collection of utilities and examples for the yum package manager. It includes utilities by different authors that make yum easier and more powerful to use. These tools include: debuginfo-install, package-cleanup, repoclosure, repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync, repotrack, verifytree, yum-builddep, yum-complete-transaction, yumdownloader, yum-debug-dump and yum-groups-manager.<\/p>\n<pre class=\"brush:bash\"># yum -y install yum-utils.noarch<\/pre>\n<p>Now use the yumdownloader command which is a program for downloading RPMs from Yum repositories. Type the following command to download httpd rpm file:<\/p>\n<pre class=\"brush:bash\"># yumdownloader httpd<\/pre>\n<p>Sample outputs:<\/p>\n<pre class=\"brush:bash\">Loaded plugins: rhnplugin\r\nhttpd-2.2.3-31.el5_4.2.x86_64.rpm | 1.2 MB 00:00<\/pre>\n<p>How Do I Extract Downloaded RPM File?<\/p>\n<p>Type the command as follows:<\/p>\n<pre class=\"brush:bash\"># rpm2cpio httpd-2.2.3-31.el5_4.2.x86_64.rpm | cpio -idmv<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you ever wanted to download the rpm package instead of installing it with yum ! you can do that with ease, that is useful when you want to keep backup of some RPMs or want to see what&#8217;s inside RPM etc.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"no","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[95,127,131],"tags":[223,263,255,261,262],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-system-administration","category-tips","category-tools","tag-centos","tag-rpm","tag-yum","tag-yum-downloadonly","tag-yum-utils"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p12j6H-9c","_links":{"self":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=570"}],"version-history":[{"count":9,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":603,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions\/603"}],"wp:attachment":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}