The apt-smart package automates robust apt-get mirror (a.k.a Repositories, Sources) selection for Debian and Ubuntu …
https://github.com/martin68/apt-smart
latest