10

Assuming that I want to install a program called leafpad later.

Currently the only way to install it is via:

yum install leafpad -y

but I want to save this and install it later without internet connection.

How can I grab it from the yum repo and save it to a folder and then install it later?

10

If you're only interest is in downloading a package + its dependencies for offline installation you can use the tool yumdownloader. It's part of the package yum-utils.

$ yumdownloader --resolve <package name>

Example

$ yumdownloader --resolve vim-X11
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
--> Running transaction check
---> Package vim-X11.x86_64 2:7.3.315-1.fc14 set to be reinstalled
--> Finished Dependency Resolution
vim-X11-7.3.315-1.fc14.x86_64.rpm                              | 1.1 MB     00:01

The above command shows the graphical version of vim, gvim being installed. Notice that it checks to see if you have the necessary dependencies installed, if not then it will download them as well.

What's the packages location

You can also find out what the URL of a given package would be using another tool included with yum-utils called repoquery. This is a fantastic tool and allows you to peer inside of repositories without having to download the packages that they offer.

For example:

$ repoquery --location vim-X11
http://kdeforge.unl.edu/mirrors/fedora-archive/fedora/linux/updates/14/x86_64/vim-X11-7.3.315-1.fc14.x86_64.rpm

NOTE: This URL is the URL from one of the repository mirrors, so it may change from run to run.

What else about the package?

You can use repoquery to answer these questions too:

What does a package require:

$ reqpoquery -R vim-X11

What does a package contain:

$ repoquery -l vim-X11

There's more consult the man page for repoquery.

  • What if my online system has some dependencies that are missing on the offline system? Is there any way to make yumdownloader be more aggressive, and grab deps even if they're locally installed? – Coderer Oct 16 '14 at 14:28
  • @Coderer - see here: unix.stackexchange.com/questions/50642/… – slm Oct 16 '14 at 14:54
  • that's perfect, thanks! If you want to give that as an answer to this question I'd gladly accept it. – Coderer Oct 20 '14 at 8:34
  • @Coderer - I wrote it up. – slm Oct 20 '14 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.