I'm using DigitalOcean for my VPS's, they provide local mirror for ubuntu.
With this simple command we can replace default ubuntu apt urls with their mirror. It's usefull for docker images.

sudo sed -i "s/archive\.ubuntu/mirrors.digitalocean/g" /etc/apt/sources.list