Install package along with all the dependencies offline [duplicate]

keryx
It's a gui application for installing packages on complete offline system.

https://launchpad.net/keryx

http://www.omgubuntu.co.uk/2010/09/keryx-offline-package-installation-made-easy-in-ubuntu

.............................................................................................

apt-offline : CLI
Let offPC is the offline computer and onPC is the online computer.

  1. Install apt-offline on offPC

  2. Download apt-offline from onPC. (try: http://packages.debian.org/wheezy/all/apt-offline/download)

  3. Copy and paste the '.deb' file to offPC

  4. Install it by opening it. (or using sudo dpkg -i '/path/to/file/apt-offline.deb')

  5. Generate update link file [offPC]
    sudo apt-offline set /tmp/updateee --update

    Generating database of files that are needed for an update.

  6. Download update files using link file [onPC]
    sudo apt-offline get /tmp/updateee

    Downloading http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-i386/Packages.bz2.
    http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-i386/Packages.bz2 done.
    Downloading http://security.ubuntu.com/ubuntu/dists/quantal-security/restricted/binary-i386/Packages.bz2.
    http://security.ubuntu.com/ubuntu/dists/quantal-security/restricted/binary-i386/Packages.bz2 done.
    Downloading http://security.ubuntu.com/ubuntu/dists/quantal-security/main/i18n/Translation-en.bz2.
    http://security.ubuntu.com/ubuntu/dists/quantal-security/main/i18n/Translation-en.bz2 done..........

    Downloaded data to /tmp/apt-offline-downloads-5942

  7. Add downloaded update files to offPC
    sudo apt-offline install /tmp/apt-offline-downloads-5942/

    gpgv: Signature made Fri 21 Jun 2013 02:08:43 PM UTC using DSA key ID 437D05B5 gpgv: Good signature from "Ubuntu Archive Automatic Signing Key " gpgv: Signature made Fri 21 Jun 2013 02:08:43 PM UTC using RSA key ID C0B21F32 gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) "

  8. Generate package link file [offPC]
    sudo apt-offline set /tmp/package --update

  9. Download package files using link file [onPC]
    sudo apt-offline get /tmp/package
  10. Add downloaded package files to offPC
    sudo apt-offline install /tmp/apt-offline-downloads-5942/
  11. Install package Open terminal sudo apt-get install package_name or
    open software center, install package.

Note1: Before using the file (updateee, package), you have to transfer the file from offPC to onPC (using Pen drive or something). Also copy the folder containing downloaded file to onPC to offPC.

Note2: If you get an error

E: Unable to locate package package_name

while installing, that means the package is not known to the offPC. This occurs due to many reason. such as Personal package maintained be private parties. (Search PPA)
Try add software sources by opeing software sources (from unity), then tick on Universe and other filds


Cube

Cube is an offline package management system that enables Linux distribution users (Ubuntu, Linux Mint and other APT-based systems) to have applications installed to their system even without internet connection. Just run the cube in your Linux system, create your project in it, paste your project together with cube in a flashdrive and fly away to any computer with internet connection, open the cube and select your project, update your applications and download any applications you want, go back to your Linux system and install it directly. And that’s it! You can now use your new application :).

You can download cube at its launchpad page : https://launchpad.net/camicricube


Have you read the methods here?

Installing packages without an Internet connection

Mentioned there,

Keryx

(mentioned earlier by answerer @totti)

Keryx is a portable, cross-platform package manager for APT-based (Ubuntu, Debian) systems. It provides a graphical interface for gathering updates, packages, and dependencies for offline computers. Keryx is free and open source. You can get Keryx here: https://launchpad.net/keryx

Synaptic package download script

Here's how: https://help.ubuntu.com/community/Synaptic/PackageDownloadScript


... Not mentioned at that site:

AptMedium

Seems the best tailored for your use case, unfortunately super immature. link

apt-offline

Looks like the best command-line tool for the job. Unfortunately, the "howto"s always start with the assumption that you have "apt-offline" already installed on the offline machine, ignoring the obvious question of how it would have got there in the first place. link


Check this folder /var/cache/apt/archives this should effectively contain all packages downloaded during the installation of package A, copy paste the same contents to /var/cache/apt/archives of second computer. try apt-get install package a

For this to work you have must have at least once did apt-get update (For getting package lists for reference on apt)

Else you can try dpkg -i packageA.deb and see missing packages and install the ones from the archives folder. (This method is ridiculous)

I had used apt cds before, try googling for creating apt cds from existing system.