During the Ubuntu installation, if your system is not connected to Internet, the installer will select the the Ubuntu Main repository for software update and installation. Otherwise (if connected) it automatically select a nearest mirror depending on your location and ISP. If you feel that your current mirror is very slow, then you can find the fastest Ubuntu apt repository using below methods.
Find Fastest Ubuntu Repository Mirror Using Apt-Smart Tool
Apt-smart is a Python tool to check the fastest Ubuntu apt mirror on your system. It is available via pip. If you don’t have then install pip using below command.
sudo apt install python3-pip
After that install Apt-smart using below command.
pip3 install --break-system-packages apt-smart
[OR]
sudo pip3 install --break-system-packages apt-smart
Find Current Mirror:
To find the current apt mirror use the below command.
apt-smart -f
Find the Best Apt Mirror:
You can find the best apt software mirror using below command.
apt-smart -b
Auto update Apt Mirrors
Using the below command Apt-smart automatically choose a best Apt mirror and automatically update the sources.list with new one.
apt-smart --auto-change-mirror
List and Rank all Apt Mirrors:
apt-smart -l
Change Mirror Manually:
apt-smart -c http://archive.ubuntu.com/ubuntu
Replace “http://archive.ubuntu.com/ubuntu” with your best mirror.