Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

Right now I have 2 computers:

  1. Has connection to the internet and has installed package A.
  2. Doesn't have connection to the WEB. On this PC I need to install package A.

I decided to download all needed packages using first PC and transfer them to the second PC via USB. I have searched how to get all needed packages for some deb installation and here's what I've found.

But when I run:

apt-get --print-uris --yes install A | grep ^\' | cut -d\' -f2 > downloads.list

on first PC I got empty file because this package is already installed there (and I don't want to uninstall it).

Also package A is very complicated and depends on package B which depends on package C and package C is not installed on the second PC.

So how can I download all needed packages? Or is there any other way of installing it?

share|improve this question

marked as duplicate by Alaukik, Eric Carvalho, Braiam, belacq, karel May 11 at 2:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I think you can generate a download script with Synaptic. help.ubuntu.com/community/SynapticHowto –  DaboRoss Jun 11 '13 at 20:03

4 Answers 4

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

share|improve this answer

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

share|improve this answer

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

share|improve this answer

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.

share|improve this answer
    
I don't think that this is safe way - this solution may crash Ubuntu on second PC. –  ArtemStorozhuk Jun 11 '13 at 20:16

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