I'm setting up an apt repository to manage dependencies for servers that I build. I'm doing this because I want to be able to repeatably build the exact same server over and over again.
There are certainly tools (
apt-get) to analyze a running system and download packages needed to satisfy a given requirement. For example, that's exactly what happens when I run
sudo apt-get install --download-only vim
In this case
apt-get analyzes the state of the system and downloads the packages needed to install vim on my system.
I'm looking for a similar tool that would allow me to download packages to add to my own apt repository. It should do the same type of dependency analysis on the repository as
apt-get does on my system, and only download packages not already in the repository. So when I run
apt-get install ... on a system that points to my repository it will be able to install the package and all of its dependencies. Are there any tools available to analyze what packages I already have in my repository and then download additional packages needed?