I generally have bad internet connection and it makes trouble when apt-get install an-app. So I am backing up .deb files in /var/cache/apt/archives regularly and copying into the same folder when I do new installation. This way, dependencies of applications with the exception of already installed ones are also backing up. And I found this command to download all dependencies of an app including the ones that already installed on my system:
apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-pre-depends <appname> | grep "^\w" | sort -u) apt-get download <appname> I use this because some dependencies of app may not be installed on a new system.
But in this condition if I upgrade any application, I also store its old .deb file on my disk. And these files becomes garbage. I need to clean this garbage from cache folder. So my question is:
Is there any way of mirroring the repository files for only specific applications and its all dependencies (and only latest versions)? Or mirror the debian repository for specific apps only using apt-mirror or something similar?