When installing or updating packages, the download speed can vary greatly depending on the location of the mirror server. Especially, using a Ubuntu mirror server operated in Korea can significantly improve the download speed.
In this post, we will introduce two ways to change the mirror server: manually changing the mirror server and using a script that automatically changes the mirror server.
The following method is based on Ubuntu 20.04 LTS.
sources.list
file with administrator privileges.sudo nano /etc/apt/sources.list
Once the sources.list
file is opened, find the address of the mirror server currently in use. You can usually find a line that starts with http://archive.ubuntu.com
or http://kr.archive.ubuntu.com
.
Deactivate the current server address through annotation (lines starting with the hash(#) symbol).
Add the Korean server mirror address. Add the following address to the sources.list
file.
deb http://mirror.kakao.com/ubuntu/ focal main restricted
deb http://mirror.kakao.com/ubuntu/ focal-updates main restricted
deb http://mirror.kakao.com/ubuntu/ focal universe
deb http://mirror.kakao.com/ubuntu/ focal-updates universe
deb http://mirror.kakao.com/ubuntu/ focal multiverse
deb http://mirror.kakao.com/ubuntu/ focal-updates multiverse
deb http://mirror.kakao.com/ubuntu/ focal-backports main restricted universe multiverse
To close the editor and save after saving, press Ctrl + X
, and to save the changes, enter Y
and press enter.
Update the repository. Run the following command in the terminal.
sudo apt update
Done! :)
Manually changing the mirror server is simple, but requires several steps. Instead, we have developed a script that automates this process.
This script is uploaded on GitHub and can be downloaded from the following link:
Mirror Manager Script Download Link
Script Github repository
Download the script from the link above.
Grant execution permissions to the downloaded script. Run the following command in the terminal.
chmod +x mirror_manager.sh
./mirror_manager.sh
When the script runs, it displays a list of available mirror servers. If you select the mirror server you want, the script automatically modifies the sources.list
file and updates the repository.