How to Update Your Arch Linux Mirrorlist

Update Your Arch Linux Mirrorlist Feature Image

If you are using Arch Linux, and wondering why a simple update took ages, even with good internet, it could be due to outdated or poorly sorted mirrorlist. Keeping your mirrorlist updated and fresh makes your system run smoothly. Let’s dive deep into Arch Linux mirrorlists, what they are, and how to update them using various methods.

What Is Arch Linux’s Mirrorlist

When you tell your package manager, pacman, to update Firefox or get the latest Linux kernel, it doesn’t just magically pull it from the cloud. It has to connect to a specific server somewhere in the world to download those files. These servers are called mirrors.

In other words, an Arch Linux mirror is simply a server that hosts a copy of the official Arch Linux repositories. There are hundreds of them scattered across the globe. Some are maintained by universities, some by ISPs, and others by dedicated Linux enthusiasts.

Viewing Arch Linux Mirrorlist Repository On Terminal

The mirrorlist itself is a simple text file located at “/etc/pacman.d/mirrorlist” on your system. If you open that file right now, you will see a long list of web addresses, each pointing to a different mirror. Pacman reads this list from top to bottom and tries the first available mirror. If that mirror is slow, offline, or hasn’t been synced in a week, your downloads crawl or fail. When you run pacman -Syu or install something new, pacman pulls packages from these mirrors.

Furthermore, Arch does not automatically sort mirrors by speed or location. That means you could be downloading packages from the other side of the planet while a faster mirror sits unused further down the list. In short, the mirrorlist decides where your system gets its software from. A well-maintained mirrorlist makes updates quick and reliable. A neglected one turns every update into a test of patience.

If you’re wondering why we need so many mirrors in the first place, it’s because they distribute the load, ensure redundancy, and provide geographical diversity so users worldwide can access packages efficiently.

Why There Is a Need to Update Mirrorlist

There are multiple reasons to update the mirrorlist. The most obvious one is speed. A server that was fast when you installed Arch Linux might be overloaded today. Maybe that server is undergoing maintenance, or perhaps it’s just having a bad day. On slower or older hardware, this makes a noticeable difference.

Another common issue is “failed retrieving file” errors. These happen because some mirrors lag behind the main Arch repositories. When pacman asks for a package version that the mirror doesn’t have yet, things break.

Docker Permission Denied Error Linux

Updating your mirrorlist ensures your system talks to the fastest and most responsive servers available to you right now. A fresh mirrorlist prioritizes mirrors that sync frequently, reducing the chances of failed or partial updates. Even with a modest internet connection, a nearby mirror can saturate your bandwidth. A distant one usually can’t.

Furthermore, Arch follows a rolling release model. That means frequent updates. Keeping your mirrorlist current fits naturally into regular system maintenance, just like clearing cache or checking disk space.

How to Update the Mirrorlist

There are several ways to update your Arch Linux mirrorlist, but the most efficient method is using the reflector tool. This tool manages Arch Linux mirrors by design. It fetches the latest mirror data, tests mirrors based on speed and synchronization, and generates a clean mirrorlist for you.

Before changing anything, make a backup of the existing mirrorlist. Open your terminal and run this:

sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup

Now you’re safe. Next, make sure the reflector is installed. If it isn’t, install it with:

sudo pacman -S reflector
Installing Reflector On Arch Linux

You can run reflector with different flags (options) to control mirror selection. Here’s a solid command to get fast, up-to-date mirrors:

sudo reflector --country US --protocol https --latest 10 --sort rate --save /etc/pacman.d/mirrorlist

This command selects recently synced mirrors, sorts them by download speed, and saves the result directly to the mirrorlist file. You can replace US with your own country or remove the country option entirely if you prefer global mirrors.

After running, refresh pacman’s database with:

sudo pacman -Syu

You’ll likely notice the speed difference immediately.

Automatic mirror updates with a timer

If you like things to run quietly in the background, you can also automate mirror updates. Luckily, Reflector comes with a systemd service that can do this for you automatically.

Start by opening the configuration file with your favorite editor, such as:

nano /etc/xdg/reflector/reflector.conf
Reflector Configuration File With Various Options And Flags

Next, edit that file to include your preferences (country, sort by rate, etc.). Then, enable the timer:

sudo systemctl enable reflector.timer
sudo systemctl start reflector.timer

This updates your mirrorlist weekly by default. You get fresh mirrors without having to think about it.

Tip: If you’re installing Arch Linux from scratch using archinstall, you can handle mirror selection during setup. Choosing the closest region gives you a decent mirrorlist from day one. Even then, updating mirrors after installation remains a good habit.

Generate the Mirrorlist Manually

If you would rather not install any extra tools, you can generate your mirrorlist manually by editing the configuration files. But first you need to generate a list using the official Arch Linux mirrorlist generator. From the website, you can create a list based on your preferences and copy that text.

Generating Mirrorlist Via Archlinux Offical Site

Next, open your mirrorlist file with any text editor:

sudo nano /etc/pacman.d/mirrorlist

Delete everything in the file (but make sure you made a backup), paste the new text you got from the website, and save the file.

After saving, run:

sudo pacman -Syyu

This forces pacman to refresh package databases using your updated mirror order. Manual editing works, but it requires regular attention.

You can also uncomment every server in the specific countries you want and then pipe that file into the rankmirrors command. It takes a long time because the script has to download data from every single server to test it. Reflector is much faster and smarter, so stick with that if you can.

Final Thoughts

Updating your Arch Linux mirrorlist might seem like a minor maintenance task, but its impact can be significant for your system. Fast, reliable mirrors mean quick updates, smooth installations, and less time spent waiting for packages to download. Further, you can also learn various ways to make your Arch Linux more stable.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Haroon Javed Avatar