Skip to content

Arch Linux | Reflector

Linux
4 1 1.5k
  • 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
  • To the Window to the Linux . . .

    Pinned Linux arch linux windows endoflife
    22
    19 Votes
    22 Posts
    2k Views
    @phenomlab said: @Madchatthew ouch. Sounds nasty. Did you get to the bottom of why it happened? I believe it is due to not everything getting upgraded because i wasn’t checking on the different packages I had installed from the AUR. Then when I ran yay it was like, hey would you like to update all of these things that you haven’t updated in months, perhaps years or ever for that matter and I was like yes please If you don’t have yay there are no notifications that you need more updates than what you realize. Chrome was staying updated because it would give me a notification, but there was the nvidia package that needed to be upgraded as well and I had never upgraded it. I didn’t realize it and should have. Then some of those packages use cmake and that needed to be updated as well. So using yay is beneficial to make sure you get all the updates you need.
  • Linux on a Stick

    Linux linux usb arch
    29
    16 Votes
    29 Posts
    4k 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
    9k Views
    @phenomlab said in Arch Server Progress: PITA LOL yes for sure!!
  • Linux Certification

    Linux linux certs
    4
    2 Votes
    4 Posts
    787 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
  • Arch Linux + Me = Crazy

    Linux arch linux web server vps
    10
    0 Votes
    10 Posts
    1k Views
    @Madchatthew hmm, yes, that might be problematic.
  • Linux vs Windows - who wins ?

    Blog windows linux
    8
    4 Votes
    8 Posts
    2k Views
    @phenomlab LOL ah yes, I remember all of that. The good ole days!
  • 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.