1

I know the way to install software on Linux i.e.

apt-get install

or

yum install

These methods will only works until we have internet connection. Is there any way, so that I can download the software from one PC with internet, then take that software to the other PC without internet & install the software there, as we can do it in Windows OS?

I tried manually downloading firefox browser from its website & then I extracted it, I got a single firefox. When I clicked on it, firefox directly open, but not installed.

3
3

On Debian /Ubuntu you can use the command apt-get download (available from version 0.8.11 of apt). It doesn't download dependencies nor other packages, and it doesn't require root permissions.

The download .deb file is easily installed using dpkg, for example: dpkg -i <deb file>.


On CentOS/RHEL 7: yum install --downloadonly --downloaddir=/tmp <package-name> will download the package to directory /tmp. If the package has unmet dependencies, yum will download all dependent packages also, and none of them will be installed.

On CentOS/RHEL 6 or earlier, you have to previously install a plugin called yum-plugin-downloadonly with the command yum install yum-plugin-downloadonly.

The downloaded rpm file can be installed with rpm -Uvh rpm_file.

3
  • Thanks for your reply but you haven't mentioned how to install those downloaded packages after downloading. – Harshit Oct 14 '15 at 8:48
  • Is there a way to download dependencies as well, on Ubuntu? – Wildcard Nov 2 '16 at 10:41
  • @Wilcard Check this answer. It's a better answer than mine and includes the way to download the dependencies. – jcbermu Nov 2 '16 at 10:46
0

Adding to jcbermu's answer, on CentOS/RHEL 6, you don't need to install any plugins; just use yumdownloader. From the man page, excerpted:

NAME
       yumdownloader

SYNOPSIS
       yumdownloader [options] package1 [package2...]

DESCRIPTION
       yumdownloader  is a program for downloading RPMs from Yum repositories.


GENERAL OPTIONS
       ...

       --destdir DIR
              Specify a destination directory for the download.   Defaults  to
              the current directory.

       ...

       --resolve
              When downloading RPMs, resolve dependencies  and  also  download
              the required packages.

So all you need for the simple case is yumdownloader --destdir /tmp --resolve somepackage.

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.