Install ‘netselect’ command and test the fastest apt mirror repository.

$ sudo -i
[sudo] password for user: 
# 
Become “root”
 
# wget http://ftp.au.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-30_amd64.deb
# dpkg -i netselect_0.3.ds1-30_amd64.deb
# netselect -s 20 -t 40 $(wget -qO - mirrors.ubuntu.com/mirrors.txt)
   25 http://ftp.riken.jp/Linux/ubuntu/
   50 https://linux.yz.yamagata-u.ac.jp/ubuntu/
   50 https://linux.yz.yamagata-u.ac.jp/ubuntu/
   52 http://ftp.jaist.ac.jp/pub/Linux/ubuntu/
   52 https://linux.yz.yamagata-u.ac.jp/ubuntu/
   55 http://ftp.tsukuba.wide.ad.jp/Linux/ubuntu/
   55 https://linux.yz.yamagata-u.ac.jp/ubuntu/
   58 http://ubuntutym.u-toyama.ac.jp/ubuntu/
  208 http://mirror.fairway.ne.jp/ubuntu/
 1035 http://archive.ubuntu.com/ubuntu/
 1103 http://archive.ubuntu.com/ubuntu/
Only found 11 hosts out of 20 requested.
Select the fastest mirror “http://ftp.riken.jp/Linux/ubuntu/” in this case.
Change /etc/apt/sources.list by following “sed” command.
 
# sed -i.bak -e "s%http://jp.archive.ubuntu.com/ubuntu/%http://la-mirrors.evowise.com/ubuntu/%g" /etc/apt/sources.list
if save backup “/etc/apt/sources.list.bak”.
 
# sed -i 's/http:\/\/jp.archive.ubuntu.com\/ubuntu/http:\/\/http:\/\/ftp.riken.jp\/Linux\/ubuntu/' /etc/apt/sources.list
if no backup “/etc/apt/sources.list”