This should be distinguished from the situation where you're trying to replicate a full package tree from an official repository and fine tuning sources priority. Random packages mean virtual packages, packages which are compiled locally or copied in a piecemeal fashion for testing purposes. Here's a simple setup based on now obsolete documentation.
First, make a directory to host the packages:
Then move your .deb package files there. Execute this command from the directory above the one we just created (make sure permissions allow this!):
dpkg-scanpackages packagedir | gzip > packagedir/Packages.gz
Now add a line to your /etc/apt/sources.list (always a good idea to back it first):
deb file:///path_to_dir_above_packagedir packagedir/
and update the apt database:
At this point the packages in our local repository can be installed like any other package using
apt-get install <packagename>. When new packages are added to the local repository, the prescribed
dpkg-scanpackages command must be issued again to update the Packages.gz file and
apt must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.