Saving deb files from repositories to a custom location for installing offline [duplicate]
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.
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 typesudo 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/
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
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.
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.
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.