100% agree with oldos2er with providing a solution.
If others want to try another method then:
Choosing the fastest mirror with "netselect" >>https://pkgs.org/download/netselect-apt
This solution is my preferred, as it guarantees the fastest mirror selection. For this we are going to use netselect command. The netselect package is not available within Ubuntu's standard repository by default, so we will need to borrow it from Debian stable repository:
Code:
sudo apt install wget
wget http://ftp.au.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-26_amd64.deb
sudo dpkg -i netselect_0.3.ds1-28_amd64.deb
You may need to double check the version.
Once you have the netselect command available on your Ubuntu system use it to locate the fastest mirror based on the lowest icmp latency. The netselect output will be relative to your location. The below example output will show top 20 apt Ubuntu mirrors ( if available ):
Code:
sudo netselect -s 20 -t 40 $(wget -qO - mirrors.ubuntu.com/mirrors.txt)
12 http://ubuntu.uberglobalmirror.com/archive/
20 http://ubuntu.mirror.serversaustralia.com.au/ubuntu/
21 http://ubuntu.mirror.digitalpacific.com.au/archive/
38 http://mirror.aarnet.edu.au/pub/ubuntu/archive/
39 http://mirror.overthewire.com.au/ubuntu/
45 http://mirror.internode.on.net/pub/ubuntu/ubuntu/
121 http://mirror.netspace.net.au/pub/ubuntu/
148 http://mirror.waia.asn.au/ubuntu/
152 http://mirror.as24220.net/pub/ubuntu-archive/
162 http://mirror.tcc.wa.edu.au/ubuntu/
664 http://archive.ubuntu.com/ubuntu/
664 http://archive.ubuntu.com/ubuntu/
3825 http://archive.ubuntu.com/ubuntu/
Only found 13 hosts out of 20 requested.
Alter manually your /etc/apt/sources.list file to reflect the above netselect results or use sed command, where the lower score number on the left represents a higher mirror transfer rate.
Example only:
Code:
sudo sed -i 's/http:\/\/us.archive.ubuntu.com\/ubuntu\//http:\/\/ubuntu.uberglobalmirror.com\/archive\//' /etc/apt/sources.list
Comparing results
The following are my apt update command results, while located within the US:
Code:
US MIRROR ( http://us.archive.ubuntu.com/ubuntu ):
Fetched 23.1 MB in 20s (1148 kB/s)
MIRROR protocol( mirror://mirrors.ubuntu.com/mirrors.txt):
Fetched 23.1 MB in 4min 45s (81.0 kB/s)
AU MIRROR ( http://au.archive.ubuntu.com/ubuntu ):
Fetched 23.1 MB in 12s (1788 kB/s)
NETSTAT Auto-Selected ( http://ubuntu.uberglobalmirror.com/archive ):
Fetched 23.1 MB in 6s (3544 kB/s)
Bookmarks