Heads up! This post was written 10 years ago. Some information might be outdated or may have changed since then.
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