Steps to setting up a simple repository for testing
Let's take logstash as an example:
1.Install dpkg-dev
sudo apt-get install dpkg-dev
2.Put the packages in a directory
Create a directory where you will keep your packages. For this example, we'll use /usr/local/mydebs.
sudo mkdir -p /usr/local/mydebs
Then download logstash 1.5.2 from official website and put it in the packages directory:
https://download.elastic.co/logstash/logstash/packages/debian/logstash_1.5.2-1_all.deb
3.Create a script that will scan the packages and create a file apt-get update can read
Let's create file ~/bin/update-mydebs ('~' means your home directory). Ubuntu will puth ~/bin in your PATH.
#! /bin/bash
cd /usr/local/mydebs
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
dpkg-scanpackages looks at all the packages in mydebs, and the output is compressed and written to a file (Packages.gz) that apt-get update can read (see below for a reference that explains this in excruciating detail). /dev/null is an empty file; it is a substitute for an override file which holds some additional information about the packages, which in this case is not really needed. See deb-override(5) if you want to know about it.
Next, make the script executable:
chmod u+x ~/bin/update-mydebs
4. Add a line to your sources.list pointing at your repository
add the line
deb file:/usr/local/mydebs ./
to your /etc/apt/sources.list, and you're done.
Whenever you put a new deb in the mydebs directory, run
sudo update-mydebs
sudo apt-get update
Now your local packages can be manipulated with Synaptic, aptitude and the apt commands: apt-get, apt-cache, etc. When you attempt to apt-get install, any dependencies will be resolved for you, as long as they can be met.
BTW, previously downloaded Packages by apt-get are generally stored on your system in the /var/cache/apt/archives
directory.
If you have installed apt-cacher you will have additional packages stored in its /packages directory.