| 80 | ==== How to select the fastest apt mirror on Ubuntu Linux ==== |
| 81 | |
| 82 | Choosing the fastest mirror with `netselect` |
| 83 | |
| 84 | The `netselect` package is not available within Ubuntu’s standard repository by default, so we will need to borrow it from Debian stable repository: |
| 85 | |
| 86 | `sudo apt-get install netselect-apt` |
| 87 | |
| 88 | nce 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 |
| 89 | |
| 90 | `sudo netselect -s 20 -t 40 $(wget -qO - mirrors.ubuntu.com/mirrors.txt)` |
| 91 | |
| 92 | 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. |
| 93 | |
| 94 | `$ sudo sed -i 's/http:\/\/us.archive.ubuntu.com\/ubuntu\//http:\/\/ubuntu.uberglobalmirror.com\/archive\//' /etc/apt/sources.list` |
| 95 | |
| 96 | ==== Manual apt mirror selection ==== |
| 97 | |
| 98 | `$ wget -qO - mirrors.ubuntu.com/mirrors.txt` |
| 99 | |
| 100 | Based on your experience select the best mirror and alter your /etc/apt/sources.list apt configuration file appropriately. |
| 101 | |