Skip to content

Arch Linux | Reflector

Linux
4 1 1.2k
  • One of the things that I have found that can be annoying with Arch is that if you aren’t updating the OS on a regular basis, you will run into not being able to due the updates because the mirrorlist will be out of date. The easiest way to circumvent this is to update Arch using sudo pacman -Syu weekly/bi-weekly.

    Another option is to install Reflector and enable and start the service so it can run on boot it is hooked into pacman when you run it. I am not sure if this would be a problem if you are using Arch as a daily driver and updating through the Software Center.

    This installs Reflector

    sudo pacman -S reflector
    

    This starts Reflector service

    sudo systemctl start reflector
    

    This allows Reflector service to start at boot

    sudo systemctl enable reflector
    

    This allows you to check on the status of Reflector

    sudo systemctl status reflector
    

    https://wiki.archlinux.org/title/Reflector

  • Madchatthewundefined Madchatthew marked this topic as a regular topic on
  • I would like to add that if you type reflector --help in the console you can see the different options you can add to the configuration file. I changed the sort to rate, so the fastest mirrors get used first. I also changed my country to US, because that is where I live and everything else I left default. While doing some research, the Reflector service should fire up about once a week or at boot. It is hooked into pacman so it may refresh when you run the update command above.

    Location of the config file: /etc/xdg/reflector/reflector.conf

  • I don’t know how I missed this, but I found out that there is a reflector.service and a reflector.timer service that should both be enabled and started. My understanding is that if you enable and start the reflector.timer service, that it will trigger the reflector.service to update the mirror list. I wanted to make sure I was covered either way and enabled and started them both. The commands are below to do this.

    sudo systemctl enable --now reflector.service

    sudo systemctl enable --now reflector.timer

    Of course you can find the source material here: https://wiki.archlinux.org/title/Reflector

  • I have another update for reflector that I just figured out.

    You will want to edit the following file and add details to make sure that every time it updates the mirror list, it is grabbing them from your country and I grab 10 and sort them by rate. This will ensure that your mirrorlist isn’t getting populated with links from other countries which can slow down you downloads.

    sudo nano /etc/xdg/reflector/reflector.conf

    This is what the file looks like.

    # Reflector configuration file for the systemd service.
    #
    # Empty lines and lines beginning with "#" are ignored.  All other lines should
    # contain valid reflector command-line arguments. The lines are parsed with
    # Python's shlex modules so standard shell syntax should work. All arguments are
    # collected into a single argument list.
    #
    # See "reflector --help" for details.
    
    # Recommended Options
    
    # Set the output path where the mirrorlist will be saved (--save).
    --save /etc/pacman.d/mirrorlist
    
    # Select the transfer protocol (--protocol).
    --protocol https
    
    # Select the country (--country).
    # Consult the list of available countries with "reflector --list-countries" and
    # select the countries nearest to you or the ones that you trust. For example:
    --country US
    
    # Use only the  most recently synchronized mirrors (--latest).
    --latest 10
    
    # Sort the mirrors by synchronization time (--sort).
    --sort rate
    

    Here are the different flag options that you can change or add to this file. I found this on google by searching arch linux reflector flags.

    Filtering Options (What to find)
    
    --country <CODE/Name>: Selects mirrors from specific countries (e.g., US, France,Germany). Use {Link: reflector --list-countries https://archlinux.org/mirrors/status/}, for a full list.
    
    --protocol <http|https>: Filters for HTTP or HTTPS mirrors.
    
    --age <hours>: Only includes mirrors synced within the last X hours (e.g., --age 12).
    
    --delay <hours>: Limits to mirrors with a reported sync delay of X hours or less (e.g., 
    
    --delay 0.25 for 15 mins).
    
    --latest <N>: Limits results to the top N newest mirrors. 
    Sorting Options (How to order)
    
    --sort rate: Sorts by download speed (requires testing, can be slow).
    
    --sort age: Sorts by most recently synced.
    
    --sort score: Sorts by overall score.
    
    --sort country: Sorts by country, useful with multiple countries. 
    
    Output Options (Where to put it)
    
    --save <path>: Writes the filtered/sorted list to a file (e.g., /etc/pacman.d/mirrorlist).
    
    --verbose or -v: Shows detailed progress and mirror info. 
    

Related Topics
  • Windows 10 End of Life

    General windows linux arch end of life
    10
    2 Votes
    10 Posts
    1k Views
    @phenomlab this looks very nice as well. It is nice that they keep the KDE Neon a rolling release so you will get those updated apps even though Ubuntu isn’t a rolling release. Is it a rolling distro? KDE neon is rolling for KDE software. The Ubuntu base OS is not, but certain packages will be updated as needed to support KDE software requiring newer library versions than what is provided by Ubuntu. Apps from the main repositories are not rolling either, and therefore can be up to two years old. Users are encouraged not to use them, and to instead get apps from Snap or Flatpak using KDE’s Discover app store. In neon, Discover is set up to only show apps from these sources, filtering out apps from the repositories.
  • Linux on a Stick

    Linux linux usb arch
    29
    16 Votes
    29 Posts
    3k Views
    @DownPW I haven’t tried either of those, I am sure they run fast as well. Linux is so versatile it is awesome!
  • Arch Server Progress

    Chitchat arch linux server web server
    52
    26 Votes
    52 Posts
    7k Views
    @phenomlab said in Arch Server Progress: PITA LOL yes for sure!!
  • Linux Certification

    Linux linux certs
    4
    2 Votes
    4 Posts
    711 Views
    @Madchatthew You might be sorry you asked This is the mentoring category below. Presently, it’s unused, but we have a dedicated area for it. https://sudonix.org/category/8/mentoring Other services https://sudonix.org/services
  • Rename videos in bulk - linux commands

    Unsolved Tips gopro linux commands
    12
    4 Votes
    12 Posts
    2k Views
    @Hari Yes, that’s one (of many) I would recommend. It’s going to be easier to do this under Windows and the fact that you are already connected using SMB is a huge plus.
  • Is plesk good over virtual min?

    Solved Linux linux
    6
    4 Votes
    6 Posts
    1k Views
    @phenomlab thank you
  • Need help with ping in linux

    Locked Linux ping ubuntu
    16
    5 Votes
    16 Posts
    3k Views
    Note to everyone else here. This user was formally banned from metabullet.com for abusing the service, and as a result, has been banned here also. Quite why this person thought it was ok to come here under the guise of an account he’d previously used at metabullet.com and hope I wouldn’t notice is beyond me. If you abuse my services once, you won’t get to use them again - period. As a reminder, the policies surrounding this service, and it’s usage can be found here
  • SASL LOGIN authentication failed: generic failure

    Moved Solved Linux
    5
    0 Votes
    5 Posts
    2k Views
    @Ash3T I’m going to mark this post as solved as I’ve not heard from you in a while. Let me know if this isn’t the case and you need more help.