4

The "Select a Mirror" section of the Beginner's Guide for Arch Linux is simple enough, but it doesn't explain why an operating system would need a list of mirrors (it's the first time I hear of this). The Mirrors page of the ArchWiki, as well as this Stack Exchange site, doesn't specifically say why I should be doing this in the first place.

What is the purpose of maintaining a list of mirrors for the disk images of my operating system? Do all Linux/Unix-based operating systems do this?

  • Where else would you download software from? – jasonwryan Dec 26 '14 at 3:44
  • Do the mirrors just contains the base and base-devel packages that are downloaded with pacstrap? – LanceLafontaine Dec 26 '14 at 3:55
  • 1
    They contain all the officially supported packages. See my answer for more. – jasonwryan Dec 26 '14 at 4:00
2

A Linux distribution such as Arch isn't really a single piece of software; instead, it's a collection of many different programs by many different authors. The maintainers of each distribution select what software to include and compile it, configure it all to work well together, and then bundle it as an operating system (this process is called packaging, and an individual piece of software prepared in such a way is referred to as a package.) That's why they're called Linux distributions. Only a small percentage of the software on your Arch Linux disk was actually written by the Arch Linux project. Most of what they do is distribute other people's software in a format that is easier to install and use.

Arch (and many other distributions) package a LOT of software, much more than could easily fit on a single disc, or even be installed on a single computer. Because of this, the install disks for Linux distributions usually only contain software that is absolutely necessary for a working system, or software that most users are likely to want to install. A program called a package manager is used to select which software to install, and can also be used later on to install additional packages or updated versions of packages that are already installed. Most package managers can install packages from the original install disks, or they can download packages from the Internet. Some install disks don't actually contain any software except for the bare minimum necessary to boot up, start the package manager, and connect to the Internet - everything else gets downloaded during the install process.

The complete collection of packages is made available on many servers all across the world. These servers all have the same collection of packages - that is why they are called mirrors. Mirrors are used so that one server doesn't have to handle the traffic from every single user. If you pick a mirror that is located in your region of the world, you are also likely to get faster downloads than from one located in a different country or on a different continent.

So, the reason you pick a mirror is so your computer knows where to download additional software and security updates from. Most Linux distributions that I am aware of use this approach, and I believe the BSDs do so as well.

4

Arch uses two tiers of mirrors; the first, Tier 1, syncs directly from archlinux.org every hour. Tier 2 mirrors sync from Tier 1. Synching from archlinux.org directly is prohibited.

This ensures that bandwidth charges are equitably distributed amongst the various mirrors and that people in diverse geographic locations are not penalized with slow downloads from mirrors on the other side of the globe. This is an efficient method to distribute the load and costs of pushing software.

Technically, you don't need to maintain a list of more than one mirror; if you have a local mirror that is reliable and does not fall out-of-date (you can check by visiting the mirror status page, or by using a tool like reflector to automatically generate an up-to-date list for you), then you can just have the single entry in your mirrorlist.

As Arch is a rolling release, it is important that you ensure that your local database is kept up-to-date (with pacman -Syu), and that you are syncing to a mirror that is also up-to-date with archlinux.org. One of the most common problems newcomers to Arch face is not understanding this relationship and then finding that they are unable to upgrade because their local database does not match the current repositories, so pacman will complain about being unable to find version xx of a package.

If you read your /etc/pacman.conf, you will see that it contains a number of repositories: [core], [extra] and [community], with the option to include [testing], [multilib] and custom repositories. These repositories contain all of the officially supported packages; so each will be synced to a mirror from archlinux.org, with the exception of custom repos which are hosted by members of the Arch community.

You can read more about how Arch mirrors work on the Wiki mirroring page.

1

Mirrors in this case refers to alternate web addresses hosting the same information so you can download what you want (packages) from the fastest one.

  • I assume that these mirrors contain the contents of my disk image, as well as additional packages like the base and base-devel ones? – LanceLafontaine Dec 26 '14 at 3:59
  • What do you mean by "your" disk image? Most of the sites in the list probably also host the install disk isos, but the purpose of the mirror list is sites that host the installable packages, i.e. the individual installables from base, base-devel, extra, etc. – Kevin Dec 26 '14 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.