jump to navigation

How To Download a RPM Package Using yum Command Without Installing On Linux February 23, 2011

Posted by Tournas Dimitrios in Linux.

My previous article ” Yum repositories on RHEL – CentOs Cheatsheet ” made an extensive presentation how to use the yum package manager utility . Yum is installed by default on all RedHat based boxes (Fedora , CentOs ..) , works “out of the package” , and covers the needs of an average user . Yum’s default functionality can be extended  with extra plug-ins , making it  even more powerful . This article will present a scenario where I had to add an extra yum utility , because the default yum installation was not providing it to me .

At the end of this article is a list of 25 yum plug-ins with a brief description .

Now let’s pretend a scenario , it’s late and we are making some configurations  on our Linux box , and we run “rm -f  /sbin/nologin” . Wrong move …… yes I know wrong move . How do we reinstall this file?

  1. yum whatprovides  /sbin/nologin —>util-linux-2.xxx.xx.rpm
  2. yum install util-linux —> package is already installed nothing to do
  3. yum-utils.noarch Package : 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.
    yum  -y  install yum-utils.noarch
  4. We are interested for the “yumdownloader” utility
    mkdir /tmp/test ; cd /tmp/test
    yumdownloader  util-linux-2.xxx.xx.rpm
  5. Let first see the directory sructure of this package
    rpm -qlp util-linux-2.xxx.xx.rpm
  6. Copy only the utility (nologin) from the package
    rpm2cpio  utillinux-2.xxx.xx.rpm |cpio -ivd ./sbin/nologin
  7. Move the utily to it’s original location (/sbin/nologin)
    mv  ./sbin/nologin  /sbin/nologin

Other plug-ins for the yum installer :

  • yum-NetworkManager-dispatcher.noarch : NetworkManager dispatcher plugin to help yum, when changing networks
  • yum-aliases.noarch : Yum plugin to enable aliases filters
  • yum-allowdowngrade.noarch : Yum plugin to enable manual downgrading of packages
  • yum-changelog.noarch : Yum plugin for viewing package changelogs before/after updating
  • yum-downloadonly.noarch : Yum plugin to add downloadonly command option
  • yum-fastestmirror.noarch : Yum plugin which chooses fastest repository from a mirrorlist
  • yum-filter-data.noarch : Yum plugin to list filter based on package data
  • yum-kernel-module.noarch : Yum plugin to handle kernel-module-foo type of kernel module
  • yum-keys.noarch : Yum plugin to deal with signing keys
  • yum-kmod.noarch : Yum plugin to handle fedora kernel modules.
  • yum-list-data.noarch : Yum plugin to list aggregate package data
  • yum-merge-conf.noarch : Yum plugin to merge configuration changes when installing packages
  • yum-priorities.noarch : plugin to give priorities to packages from different repos
  • yum-protect-packages.noarch : Yum plugin to prevents Yum from removing itself and other protected packages
  • yum-protectbase.noarch : Yum plugin to protect packages from certain repositories.
  • yum-refresh-updatesd.noarch : Tell yum-updatesd to check for updates when yum exits
  • yum-security.noarch : Yum plugin to enable security filters
  • yum-tmprepo.noarch : Yum plugin to add temporary repositories
  • yum-tsflags.noarch : Yum plugin to add tsflags by a commandline option
  • yum-updateonboot.noarch : Run yum update on system boot
  • yum-upgrade-helper.noarch : Yum plugin to help upgrades to the next distribution version
  • yum-utils.noarch : Utilities based around the yum package manager
  • yum-verify.noarch : Yum plugin to add verify command, and options
  • yum-versionlock.noarch : Yum plugin to lock specified packages from being updated

yum-downloadonly.noarch : Yum plugin to add downloadonly command option


1. How to List the Files Installed by the YUM Package Manager « Tournas Dimitrios - November 2, 2012

[…] How To Download a RPM Package Using yum Command Without Installing On Linux […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s