I did it before and used apt-mirror, and that does exactly what I want. However now I want to do it slowly, so I want to limit the bandwidth it uses to download. Is there any easy way to do it? Any magic apt configuration setting?
After I looked at the source code for apt-mirror, I discovered that apt-mirror has inbuilt abilities to limit the bandwith rate.
set limit_rate 50k
In your mirror.list file and it will pass that into wget. However that limit is per thread. So if you have 10 threads, this will be 50k * 10 = 500k. This feature is not documentated at all.
apt-mirror is just a Perl wrapper for
wget. You could edit the source code to utilise the
--limit-rate which takes a download speed expressed in bytes, kilobytes or megabytes.
Depending upon your understanding of Perl, you could either do this the right way, by adding a new configuration option and ideally submitting a patch back to the author. Or you can just hardcode the value that you need for the moment.