Some situations call for manually installing a local package using dpkg -i <packagename>
. Sometimes it may be further useful to leverage the functionality of apt
with that package so the question is:
How do you quickly create a local repository for random packages using a Debian based linux distribution – like Xubuntu 13.04/Ubuntu?
Best Answer
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!):
Now create a file with extension
.list
in/etc/apt/sources.list.d/
with the contents: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 prescribeddpkg-scanpackages
command must be issued again to update the Packages.gz file andapt
must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.