Pages

17 January 2009

Local repository

Sometimes you need to install .deb packages even when you are offline. That is when having a local repository comes in very handy. I searched google for different ways but as usual the simplest, easiest way suited me most.

Here is a summary of the steps I took:


1.- Create a directory. I did it in my home folder.
$ mkdir /home/chals/.local_repository/binary


2.- I copied there all my .deb packages
$ cp *.deb /home/chals/.local_repository/binary

3.- I generated the file Packages.gz
$ cd local_repository
$ dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
4.- I added the repository to my sources.list (You know the drill, use vim or tee)
deb file:///home/chals/.local_repository/ ./

5.- I updated and installed
sudo apt-get update && apt-get install packages