Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to install packages using apt-get install without having HTTP access? In other words, can apt-get install packages from a small local repository?

I know I can use sudo dpkg -i deb_file to install a package, but this will install only one package at a time and it will fail if the dependencies are not met. This will be a problem if I want to install a package that has many dependencies even if I already have all the required .deb files.

share|improve this question
@Tshepang: I updated the title to include FTP. – Khaled Nov 25 '10 at 15:07
up vote 3 down vote accepted

The common work-around is to put your .deb files into /var/cache/apt/archives/. Then any apt-get install will look for the files in that cache first, and then try to download them if they are not there.

Alternatively, you can dpkg -i *.deb to install all packages in the current directory.

share|improve this answer
I remember I tried the second way using dpkg, and it did not work. I think because the packages are not installed in the required order! I still can try the first option. Thanks! – Khaled Nov 25 '10 at 9:58

If you are looking to install standard Debian packages you could use apt-zip that allows you download packages offline and transfer them onto the machine on some sort of removable media. I haven't really used it for a number of years but when I had a slow network connection at home it was a very useful tool.

share|improve this answer

You can use apt-offline or apt-offline-gui.
Pre-requistes: A friend's system with Internet connection. apt-offline installed in both your systems.

The Offline installation is achieved in 3 simple steps.

Step 1:
Generate a signature file on the Disconnected Debian box at home
apt-offline set /tmp/apt-offline.sig
The above command will generate all information required from apt about updating its database.

Step 2:
Download data based on the signature file generated earlier
apt-offline get C:\apt-offline.sig --threads 5
The above command will download data as mentioned in the signature file. To speed up downloads (that can be from multiple apt repositories), in this example we spawn 5 download threads.
Once completed, you could just copy the data (an archive file, if you used the --bundle option) back to the removable medium and copy it back onto your offline host.

Step 3:
Once you're back upon the home Debian machine, you feed the data from the removable medium to apt-offline:
apt-offline install /media/USB/
This will update the APT database on your disconnected machine seamlessly.

Apt-offline can be even used in Windows systems. In my opinion, apt-offline is the best option for Offline installation.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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