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.

Harshit
  • 149

2 Answers2

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.

jcbermu
  • 4,736
  • 18
  • 26
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.

Wildcard
  • 36,499