- Digg It :::
- Slashdot It
By : vasanth
<Update> Though this guide is written for users who do not have Internet access at one place but can access it somewhere else, if your Internet enabled box is a Linux box then you do not have to go through the steps provided in this guide (Please refer the comments section). If your Internet enabled box is a Windows/Mac and if you cannot install any emulators on it, then this guide is for you.<Update/>
Without an Internet connection, installing applications in Linux is a nightmare because of package dependencies. The aim of this guide is to help install applications in Ubuntu (should work with all apt based distribution with minimal modifications) when there is no internet connection is available. As Synaptic is used to generate the download script, all the dependency problems will be managed automatically.
Pre-requisites:
1. Access to an internet connection at a different place from/to where you can copy files.
2. Synaptic Package Manager.
Introduction to APT Repositories:
APT repositories contain packages and meta information about packages and repositories. In Ubuntu, the APT repository sources are maintained under the directory "/etc/apt". The official Ubuntu repository is defined as follows (in the file /etc/apt/sources.list).
deb http://archive.ubuntu.com/ubuntu/ hardy universe restricted multiverse main
Explanation:
deb: Repository Type - binary(pre compiled) / deb-src(source).
http://archive.ubuntu.com/ubuntu/: URI of the repository
hardy: Distribution version
universe restricted multiverse main: Repository categories
All package information is stored in the Packages.gz. This file will be present in every repository category.
Installing Applications:
When the command 'apt-get update' is issued or the 'reload package information' is requested through a GUI package manager, it will download the Package.gz (and other files) and update the repository details. We'll follow the below steps to install the applications.
We'll use "machine1" to denote the PC where no internet is available and "machine2" for the internet enabled PC.
- Download the Package.gz files manually for every repository category(machine2).
- Copy the files to machine1 and set up local repositories.
- Generate download script using Synaptic.
- Modify the script with actual package URLs.
- Download the packages in the script (machine2).
- Transfer them to machine1 and install.
The steps 1 to 4 are performed in "machine1".
STEP 1: Backup the sources.list file.
vasanth@vasanth-laptop:~$ sudo cp /etc/apt/sources.list /home/vasanth/
STEP 2: List all the Ubuntu repositories that are enabled.
vasanth@vasanth-laptop:~$ sudo cat /etc/apt/sources.list|grep ^deb
The output for me looked like this:
deb http://archive.canonical.com/ubuntu hardy partner
deb http://archive.ubuntu.com/ubuntu/ hardy universe restricted multiverse main
deb http://security.ubuntu.com/ubuntu/ hardy-security universe multiverse restricted main
deb http://archive.ubuntu.com/ubuntu/ hardy-updates universe multiverse restricted main
deb http://archive.ubuntu.com/ubuntu/ hardy-proposed universe multiverse restricted main
deb http://archive.ubuntu.com/ubuntu/ hardy-backports universe multiverse restricted main
We will be using only the "deb http://archive.ubuntu.com/ubuntu/ hardy universe restricted multiverse main" Ubuntu repository in this guide. You can use as many repositories as you want.
Copy the "deb http://archive.ubuntu.com/ubuntu/ hardy universe restricted multiverse main" to a text file(temp_work.txt).STEP 3: Using third-Party Repositories:
We can also use third party repositories like "medibuntu". To get the package information for medibuntu, open
Synaptic-->settings-->repositories-->Third-part Software.
Select the medibuntu repository and "Edit".
Copy the URI/Distribution/Components and paste it in the text file we used in STEP 2.
The copied information will look like
http://packages.medibuntu.org/ hardy free non-free
STEP 4: Disabling all the repositories:
Now uncheck all the repositories under "ubuntu software", "third-party software" and "updates" in repository manager and reload the package information in Synaptic. Synaptic will now list only the installed packages. You can see the total number of "listed" and "installed" packages in the below screen shot.
STEP 5: Find the Packages.gz file URLs:
As we have the repository information with us, we will form the URLs to download the Packages.gz files. The text file temp_work.txt has two repositories.
The Ubuntu official repository "deb http://archive.ubuntu.com/ubuntu/ hardy universe restricted multiverse main" has four categories (universe restricted multiverse main). So we have four URLs from where we need to download the Packages.gz files.
The package file for the repository "http://archive.ubuntu.com/ubuntu/ hardy main" will reside in the directory "http://archive.ubuntu.com/ubuntu/dists/hardy/main/binary-i386/"
http://archive.ubuntu.com/ubuntu/: Repository URI
dists/hardy/main/binary-i386/: Location of the package file for the hardy i386 architecture(you need to change "binary-i386" part if your arch is different). You can find the directory name for your arch under the directory "http://archive.ubuntu.com/ubuntu/dists/hardy/main/".
Following are the URLs for other categories.
http://archive.ubuntu.com/ubuntu/dists/hardy/multiverse/binary-i386/ http://archive.ubuntu.com/ubuntu/dists/hardy/restricted/binary-i386/ http://archive.ubuntu.com/ubuntu/dists/hardy/universe/binary-i386/
For Medibuntu: (http://packages.medibuntu.org/ hardy free non-free)
http://packages.medibuntu.org/dists/hardy/free/binary-i386/ http://packages.medibuntu.org/dists/hardy/non-free/binary-i386/
STEP 6: Create local directories and download the Packages.gz files:
Create local directories as follows in "machine2" and download the Packages.gz file to its corresponding directories. I'm assuming that both computers use Linux and both have the user vasanth (/home/vasanth).
STEP 7: Transfer the downloaded files to "machine1":
Copy the "local_repositories" directory from "machine2" to the "machine1". The directory structure for the example we are using will look like this.
STEP 8: Add local repositories to Synaptic:
We need to add two repositories in Synaptic.
Open Synaptic--->settings-->repositories--->Third-party Software-->Add.
To add the "deb http://archive.ubuntu.com/ubuntu/ hardy universe restricted multiverse main" repository, enter
deb file:///home/vasanth/local_repositories/ hardy main multiverse restricted universe
For the "deb http://packages.medibuntu.org/ hardy free non-free" repository,
deb file:///home/vasanth/local_repositories/ medibuntu free non-free
We need to reload Synaptic. Synaptic will download all the Packages.gz files and update the package information if everything is fine. As you can see from the below screen shot, the available packages have been increased to 24843 from 1428.
STEP 9: Generate the download script:
Select the applications you want to install with all its dependencies. I've used "mythtv" and "googleearth" for this example. After marking all the required applications, go to File-->Generate file download script and save the script.
STEP 10: Replace the local repositories with actual URLs:
vasanth@vasanth-laptop:~$ sudo edit "saved download script filename"
Replace the "file:///home/vasanth/local_repositories/pool/main/" with actual URL for the repository category "main" which is "http://archive.ubuntu.com/ubuntu/pool/main/".
http://archive.ubuntu.com/ubuntu/: Repository URI (which you can get from the temp_work.txtpool : Repository directory
main : Repository category
In the same way for all the repository categories, change the local file location to URL and save the file.
Medibuntu:
STEP 11: Download the ".deb" files and transfer:
Download all the ".deb" files in the file which we generated in STEP 10 in "machine2". You can use fdm download manager if "machine2" is a windows box to download all files in a file.
Copy the downloaded files to "/var/cache/apt/archives/" directory in "machine1".
vasanth@vasanth-laptop:~$ sudo cp *.deb packages /var/cache/apt/archives/
STEP 12: Install the applications:
Open Synaptic and mark the applications downloaded (in our case "mythtv' and "googleearth") and install them. The summary before installation should show "0 B have to be downloaded" (which means all packages are available).
Final Thoughts:
You can use a shell script to automate most of these steps. You should use a faster mirror while downloading these packages rather than using the Ubuntu main server.








Alternate Method
On a computer which has Internet access, you can use a fresh install of your Ubuntu version in a virtual machine, then type the following commands in a terminal:
sudo apt-get clean
sudo apt-get install
When you are finished, take all the .deb files in /var/cache/apt/archives and move them to a USB key.
Insert the key in the target machine and type
sudo dpkg -i /path/to/debs/*.deb
That should cover you.
Re: Install Applications in Ubuntu without Internet
Works just as well with RPM based distributions like Mandriva. All it is, is a local Mirror. No big deal.
Re: Install Applications in Ubuntu without Internet
If I had no internet on computer_1, but got it with computer_2, I would use Synaptic in "Download packages only mode" to get whatever program I needed on comp_1 then just transfer files and install it on the other machine. Easy as that.
Re: Install Applications in Ubuntu without Internet
I agree with "sam". This guide is a little overly complex. If you want a local mirror to browse applications and install them - follow this method. If you know the application you want - download the the "packages only" from synaptic and transfer them to your favorite portable media. Take it over to the non-Internet machine and install all the debs. Easy as that.
vasanth, perhaps you should clarify your objectives first. This is really rather overcomplicated for a simple local application dependancy install.
- Jeff
Re: Install Applications in Ubuntu without Internet
You can also go to http://packages.ubuntu.com/. You can download any needed packages there without the need for Synaptic.
Re: Install Applications in Ubuntu without Internet
This works with any Debian or Debian derivative. Please folks, Ubuntu != Linux.
There are two Debian utilities that make creating a local mirror very easy: apt-proxy and apt-mirror. apt-proxy automates creating a partial mirror, and apt-mirror automates creating a complete mirror.
Re: Install Applications in Ubuntu without Internet
I simply pull down the required repositories to my server using wget, and link to them from each machine on my network.
Re: Install Applications in Ubuntu without Internet
Thank you all for your comments.
Sam,Daeng Bo and tracyanne:
Yes, I agree that installing debs is easy if the computer with Internet is a Linux box. If it is a windows box then
and you cannot install any emulator on that machine then package dependencies is a real problem
Jeff:
Yes, perhaps this guide is more useful if you have Internet on a non-Linux box. Most people use Linux at home and
windows at office like me. I'll update the Objective of this guide.
James:
Downloading from packages.ubuntu.com will not solve the package dependencies unless you are ready to trace all
the dependencies.
Re: Install Applications in Ubuntu without Internet
I have internet on a non-linux box..but don't have any gui on my linux box (still trying to install ubuntu desktop)
how do i transfer this files cos u show a gui transfer
Re: Install Applications in Ubuntu without Internet
NOOB:
I'm not sure how to generate the download script without using Synaptic. I'm not able to find a method to
generate the script using apt-get.Will update you when i have something.
Re: Install Applications in Ubuntu without Internet
NOOB:
You can refer the URL "http://beans.seartipy.com/2006/05/06/update-or-install-applications-on-debianubuntu-without-an-internet-connection/".
Re: Install Applications in Ubuntu without Internet
"If your Internet enabled box is a Windows/Mac and if you cannot install any emulators on it, then this guide is for you."
step 6:" I'm assuming that both computers use Linux"
Re: Install Applications in Ubuntu without Internet
Good guide.. I was ripping my hair out over all those dependancies. Too bad there isnt something on teh net that will resolve the dependancies for us?
Re: Install Applications in Ubuntu without Internet
Good post Vasanth, it was very helpful to me. Just a small change you can do on your post to cut down some steps. When you talk about changing the url from the download script, you can get the same effect by doing the following thus avoiding using Find 3 times:
Ubuntu:
Find: file:///home/vasanth/local_repositories/
Replace: http://archive.ubuntu.com/ubuntu/
Medibuntu:
Find: http://archive.ubuntu.com/ubuntu/pool/non-free/
Replace: http://packages.medibuntu.org/pool/non-free/
Find: http://archive.ubuntu.com/ubuntu/pool/free/
Replace: http://packages.medibuntu.org/pool/free/
Re: Install Applications in Ubuntu without Internet
Does it exist script which is able to automatically create directory structure and download files for some architecture?
Re: Install Applications in Ubuntu without Internet
@Pedja:
I could not find one. If you find one notify here.
Thanks
Re: Install Applications in Ubuntu without Internet
Chk out this kewl idea here...
http://fasterthanlight.wordpress.com/2009/01/05/packgs-without-internet/
Re: Install Applications in Ubuntu without Internet
Thats really great step by step tutorial vasanth, its really saved me a lot of time.
Re: Install Applications in Ubuntu without Internet
GREAT GUIDE! I was needing one of these a few month back lol.
Thanks,
Re: Install Applications in Ubuntu without Internet
Actually the case is a PC with Windows as well as
Linux by dual boot. My PC has both WXP and Ubuntu 8.10
I can access net and download anything with my mobile
as bluetooth modem in WXP which turned out to be
impossible in Ubuntu 8.10 even after following many
tutorials one by one.
You should update your tutorial with these informations too.
Re: Install Applications in Ubuntu without Internet
@Hari:
I think your issue with Ubuntu is not at all related to
this article.
Re: Install Applications in Ubuntu without Internet
What I meant was, Machine1 and Machine2 could be one PC as I have discribed. I can download any of the applications for ubuntu using WXP but cannot install them as Ubuntu have to download something from the repository at the time of install. So my request was to update your tutorial with a similar situation rather than one location/PC with internet and another one without.
Re: Install Applications in Ubuntu without Internet
@Hari:
My understanding is, you are not able to connect to internet from your Ubuntu installation.
If you are able to connect using Windoze, then you can use this guide. There is no need to
update this guide. In this case you can use Ubuntu Live CD ISO in VirtualBox download the packages
you need and copy them to your Ubuntu installation.
Correct me if my understanding is not what you are describing.
Re: Install Applications in Ubuntu without Internet
I understand my case : PC with WinXP and Ubuntu 8.10 dual boot .
Ubuntu has been installed without internet connect to PC before.
I have no ADSL line in my place ,and my PC has no WIFI card ,
so I use a wireless 108G USB adapter for modem.
This device only works in WinXP to connect wifi internet.
I may download all needed packages of UBUNTU (such as mc,scim-unikey , qcad,gparted,VirtualBoxPUEL....)
in WINXP partition then save them in a USB flash disk.
When reboot to UBUNTU , I follows the instructions in this tutorials.
Anythings wrong with my understanding ( a newbie of UBUNTU )?
I 'll try the tutorial and post the result later.
thanks.
Re: Install Applications in Ubuntu without Internet
@ nnphung :
Yes..but you need to setup the local repositories as given in the tutorial before downloading the packages.
I hope this helps.
Re: Install Applications in Ubuntu without Internet
you can try http://wapt-get.googlecode.com
it is almost good! :D
Re: Install Applications in Ubuntu without Internet
i was instlled Ubuntu Linux is very nice.
but i am not able install any therd party software.
Plase help how install application method
this is a first installed
Re: Install Applications in Ubuntu without Internet
@Ganesh:
Can you explain what third party software you are trying to install?
May be you can list the applications you want to install.
Re: Install Applications in Ubuntu without Internet
hi i hav a computer with Internet conn. running XP another without any network connection and i plan to install jaunty on that machine how can i install all updates without internet
plz mail me on cvsidene@gmail.com
Re: Install Applications in Ubuntu without Internet
hey,
it looks like a good guide but i get stuck at the
10th step.
when i type
sudo edit "saved download script filename"
in the terminal (yes i replaced saved dwonlaod script file name with the right file name)
the terminal says it can't do it because it has a wright protection or something.
so i hope you can help me.
mail me at: travolter9@gmail.com
grtzz
Re: Install Applications in Ubuntu without Internet
How do you get synaptic in windows?
Re: Install Applications in Ubuntu without Internet
Thanks, this guide matches my situation exactly
Re: Install Applications in Ubuntu without Internet
excellent
Re: Install Applications in Ubuntu without Internet
You may want to check out this site too...
http://fasterthanlight.wordpress.com/2009/01/05/packgs-without-internet/