I was actually hoping to use the -m switch to point to a local apt-cacher-ng instance to make reinstallations quicker. When testing my freshly set up apt-cacher-ng Docker container I tried supplying its IP as a mirror only to discover it was ignored.
Since it is possible that users might supply invalid hostnames, my thought would be to try to use curl or wget to try and HEAD the Releases/Packages file for the -d distribution and -r release the user requested, and then write the mirror information to /etc/apt/apt.conf.d/proxy or tweak the /etc/apt/sources.list file or move it to a backup location and put the mirror information into a sources.list.d/mirror.list file for apt to use for the duration of the installation.
I was actually hoping to use the
-m
switch to point to a localapt-cacher-ng
instance to make reinstallations quicker. When testing my freshly set upapt-cacher-ng
Docker container I tried supplying its IP as a mirror only to discover it was ignored.Since it is possible that users might supply invalid hostnames, my thought would be to try to use
curl
orwget
to try andHEAD
the Releases/Packages file for the-d
distribution and-r
release the user requested, and then write the mirror information to/etc/apt/apt.conf.d/proxy
or tweak the/etc/apt/sources.list
file or move it to a backup location and put the mirror information into asources.list.d/mirror.list
file for apt to use for the duration of the installation.