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.

Possible Duplicate:
How can I install software offline?

I want to download and save some deb files, and preferably their dependencies, of certain apps, from the repositories (apt-get, aptitude) to a custom location without installing, so that I can install those apps while the machine is off-line. Also I want to know if it is possible to download deb files for a 64 bit machine on a 32 bit machine.

share|improve this question

marked as duplicate by Marco Ceppi Jun 5 '11 at 19:55

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.

add comment

7 Answers 7

up vote 13 down vote accepted

You can save all the deb files with dependencies using the following command

sudo apt-get --download-only install packagename

And the files will be stored under /var/cache/apt/archives

If you need to download Ubuntu packages using another machine or OS, check the desired packages in Synaptic and select File > Generate package download script.
You can download 32 bit and 64 bit packages for offline installation here.

Note:
First run apt-get clean, so that the directory will be empty. then if you want (say) a2ps package and all dependencies, you should type
sudo apt-get --download-only install a2ps.The packages will be stored in /var/cache/apt/archives.You can use this for offline installation.

You can also download packages for offline installation in the below site, http://packages.ubuntu.com/

share|improve this answer
add comment

Keryx can download packages for any offline Ubuntu computer from any online Linux or Windows computer.

Just create a "Keryx project" on the offline computer, load it on your online computer to download packages, then return to the offline computer for installation.

Check out the tutorial for step-by-step instructions.

share|improve this answer
add comment

I think this will answer the first part of your question, yes you can download packages for offline installation, when you use the synaptic package manager and select an application for installation there is an option in the dialog that pops up after the apply button is pressed that says; download package files only,if you check this and you have either the "Leave all downloaded packages in the cache" or "Only delete packages which are no longer available" checked in the dialog in synaptic, your application package and dependencies will be available to you offline in this location; /var/cache/apt/archives, after you click apply and synaptic finishes.

you can use apt-get with the -d switch to do this by typing in your terminal; sudo apt-get -d install package.

share|improve this answer
add comment

you can download packages only from manufacturer sites and you can also files for a 64 bit machine on a 32 bit machine...

share|improve this answer
add comment

if it's just something form the main repository and you don't need dependencies and stuff, you can try looking in http://packages.ubuntu.com/

you can download packages to wherever for whatever. if it's something that has a lot of dependencies though it can be annoying to to search them all on that site and download them separately.

share|improve this answer
add comment

I got tired of re-installing all my software after a fresh install, so here's what I did...

mkdir /home/jj/Documents/Repository

and a loop to get them there...

for i in `ls -1 /var/cache/apt/archives` ; do sudo cp /var/cache/apt/archives/$i /home/jj/Documents/Repository ; done

They are owned by root, so I 'chown jj:jj *' so I could copy them to my backup medium. ( I have /home as sda3, so manual partition setup during (re)-install saves my /home partition).

To re-install all of them in 1 kickstart:

sudo dpkg -i /home/jj/Documents/Repository/*.deb

And here's a bash script because we HATE typing repetitive stuff.

#!/bin/bash
for i in `ls -1 /var/cache/apt/archives/` ; do sudo cp /var/cache/apt/archives/$i /home/jj/Documents/Repository ; done

You can ignore this error "cp: omitting directory `/var/cache/apt/archives/partial'"

Mine is empty.

Here's a cleanup script by karthick87

share|improve this answer
add comment

You can use the Apt-Off script : https://help.ubuntu.com/community/AptGet/AptOfft

Copy it to a usb disk and on the PC without Internet go to the usb disk directory with a terminal and then :

./apt-off --generate something anotherthing ect

or

./apt-off --generate dist-upgrade

That will create a file named offline.packages on the usb disk. Plug the usb disk on a PC with Internet (a Linux distribution but you don't need to have apt, you just need wget) and then :

./apt-off --download

That will download all the necessary packages on the usb disk. Wait until it's finished and then plug the usb disk on the PC without internet and :

./apt-off --extract

And you're done.

share|improve this answer
add comment

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