Raspberry Pi

How to Change Repository Mirror on Raspberry Pi OS

A repository mirror is a technique by which we can mirror the external repositories to the default repository of Linux distributions. We can also define a repository mirror as making a clone of your repository including all the tags, branches, and everything you have in your repository. When you mirror the repository, you ensure every user in the network that they are using the latest and same version of the repository.

We will learn the method of changing the repository mirror for the Raspberry Pi operating system for the understanding of readers.

How to change the repository mirror on the Raspberry Pi operating system

The Raspberry Pi operating system updates itself twice a day which is its unique feature and still if you want to change the repository mirror, first, we have to find out the repository mirror with which we can change the default repository for which we will visit the link:

Choose the mirror according to your continent, for example, we are living in the Southern USA, so our mirror URL will be:

http://mirror.ufam.edu.br/raspbian/raspbian/

Now we will open the source file using the nano text editor:

$ sudo nano /etc/apt/sources.list

Now find out the lines marked in the figure below:

These green URLs will be used to update the repository so uncomments the default URLs and add your URL as shown in the image:

deb http://mirror.ufam.edu.br/raspbian/raspbian buster-updates main contrib non-free

Now update the repository using the command:

$ sudo apt update

Conclusion

Repository mirror is a technique by which you can update the repository and make sure that every user in the network has the same version of the repository. In this guide, we have listed down all the repository mirrors available for different countries and discussed the method by which we can use it in our operating system.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.