{"id":122537,"date":"2024-06-21T19:51:29","date_gmt":"2024-06-21T19:51:29","guid":{"rendered":"https:\/\/linuxiac.com\/?p=122537"},"modified":"2024-06-21T23:11:35","modified_gmt":"2024-06-21T23:11:35","slug":"how-to-find-fastest-arch-linux-mirror","status":"publish","type":"post","link":"https:\/\/linuxiac.com\/how-to-find-fastest-arch-linux-mirror\/","title":{"rendered":"Finding the Most Up-to-Date and Fastest Arch Linux Mirrors"},"content":{"rendered":"\n<p>Okay, you&#8217;ve <a href=\"https:\/\/linuxiac.com\/arch-linux-install\/\" data-type=\"post\" data-id=\"35761\">installed Arch<\/a>. Congratulations! One of the first things you should do after that is update your system. Since <a href=\"https:\/\/linuxiac.com\/archlinux\/\">Arch Linux<\/a> is a rolling-release distro, regular updates via Pacman are a must to keep it healthy.<\/p>\n\n\n\n<p>However, this can be annoying if you experience slow software download speed. But what if I told you that among the vast selection of tools in Arch, there is one that can significantly boost the speed of your updates?<\/p>\n\n\n\n<p>Meet Reflector, a powerful utility in the Arch arsenal, with the help of which such inconveniences become a thing of the past.<\/p>\n\n\n\n<p>It helps users select the fastest and most up-to-date mirrors for the <a href=\"https:\/\/linuxiac.com\/how-to-use-pacman-to-manage-software-on-arch-linux\/\">Pacman package manager<\/a>, which can significantly speed up software installation and updating. Let me show you how to use it. But before that, let&#8217;s say a few words about the tool itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Reflector?<\/h2>\n\n\n\n<p>Reflector is a Python script designed for Arch Linux systems. It scans and selects the fastest and most synced mirrors based on bandwidth, response time, and when the mirror was last refreshed.<\/p>\n\n\n\n<p>It also updates the mirror list (&#8220;<em>\/etc\/pacman.d\/mirrorlist<\/em>&#8220;) for Pacman, ensuring you always have the best sources for your software updates and installations. By using Reflector, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatically rank mirrors based on speed and stability.<\/li>\n\n\n\n<li>Filter mirrors based on your geographical location.<\/li>\n\n\n\n<li>Update your mirror list regularly to ensure the fastest possible package downloads.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Reflector: Pick the Fastest Arch&#8217;s Mirrors Automatically<\/h2>\n\n\n\n<p>Here&#8217;s how to use the tool to find the fastest and most up-to-date mirrors providing the best speed to your computer for use with Pacman.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Reflector<\/h3>\n\n\n\n<p>Before optimizing your mirror list, you need to install Reflector. It is a simple task. Open your terminal and run the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo pacman -S reflector rsync<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-02.jpg\"><img decoding=\"async\" width=\"962\" height=\"251\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-02.jpg\" alt=\"Installing Reflector\" class=\"wp-image-122855\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-02.jpg 962w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-02-380x99.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-02-768x200.jpg 768w\" sizes=\"(max-width: 962px) 100vw, 962px\" \/><\/a><figcaption class=\"wp-element-caption\">Installing Reflector<\/figcaption><\/figure>\n\n\n\n<p>This command will download and install Reflector along with any necessary dependencies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Backup Your Current Mirrorlist<\/h3>\n\n\n\n<p>Next, it is a good idea to back up your existing mirror list in the file &#8220;<em>\/etc\/pacman.d\/mirrorlist<\/em>&#8221; before making changes.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo cp \/etc\/pacman.d\/mirrorlist \/etc\/pacman.d\/mirrorlist.backup<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>However, it is not critical because, if needed, you can easily recreate it using Arch&#8217;s online tool at&nbsp;<a href=\"https:\/\/archlinux.org\/mirrorlist\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/archlinux.org\/mirrorlist\/<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-03.jpg\"><img decoding=\"async\" width=\"1024\" height=\"712\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-03-1024x712.jpg\" alt=\"Generate mirrorlist file via Arch's online tool.\" class=\"wp-image-122843\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-03-1024x712.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-03-380x264.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-03-768x534.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-03.jpg 1357w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Generate mirrorlist file via Arch&#8217;s online tool.<\/figcaption><\/figure>\n\n\n\n<p>Choose your preferred countries, typically your own or neighboring ones, and click the &#8220;<em>Generate List<\/em>&#8221; button. This will create text content you can copy and paste directly into the &#8220;<em>\/etc\/pacman.d\/mirrorlist<\/em>&#8221; file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Get the Most Up-To-Date Arch&#8217;s Mirrors<\/h3>\n\n\n\n<p>Not all mirrors are equally up-to-date, as the synchronization interval varies depending on how often the administrators of each mirror choose to set it. This means some of them may have newer software more quickly than others.<\/p>\n\n\n\n<p>We all want our Arch systems to use mirrors that provide the most actual software versions, meaning they have recently been synced with the main Arch servers. This is done very easily with the help of Reflector, as the command we need to execute is:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo reflector --latest 10 --sort rate --save \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>As a result, you get the ten most recently synchronized mirrors automatically populated in your &#8220;<em>\/etc\/pacman.d\/mirrorlist<\/em>&#8221; file, replacing its current contents and sorting them by download rate. You can easily view the final result by running:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">cat \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-04.jpg\"><img decoding=\"async\" width=\"962\" height=\"570\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-04.jpg\" alt=\"Get the ten most recently synced Arch's mirrors.\" class=\"wp-image-122867\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-04.jpg 962w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-04-380x225.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-04-768x455.jpg 768w\" sizes=\"(max-width: 962px) 100vw, 962px\" \/><\/a><figcaption class=\"wp-element-caption\">Get the ten most recently synced Arch&#8217;s mirrors.<\/figcaption><\/figure>\n\n\n\n<p>Additionally, it&#8217;s worth noting that the <code>reflector<\/code> command operates silently in the background without showing any output while it runs. You might also see a multiple message like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">&#91;<span class=\"hljs-number\">2024<\/span><span class=\"hljs-number\">-06<\/span><span class=\"hljs-number\">-21<\/span> <span class=\"hljs-number\">08<\/span>:<span class=\"hljs-number\">34<\/span>:<span class=\"hljs-number\">52<\/span>] WARNING: failed to rate http(s) download (https:<span class=\"hljs-comment\">\/\/mirrors.neusoft.edu.cn\/archlinux\/extra\/os\/x86_64\/extra.db): Download timed out after 5 second(s).<\/span>\n&#91;<span class=\"hljs-number\">2024<\/span><span class=\"hljs-number\">-06<\/span><span class=\"hljs-number\">-21<\/span> <span class=\"hljs-number\">08<\/span>:<span class=\"hljs-number\">34<\/span>:<span class=\"hljs-number\">58<\/span>] WARNING: failed to rate http(s) download (https:<span class=\"hljs-comment\">\/\/md.mirrors.hacktegic.com\/archlinux\/extra\/os\/x86_64\/extra.db): Download timed out after 5 second(s).<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Don&#8217;t worry about them. It doesn&#8217;t mean a problem with the Reflector itself; it simply indicates that the mirror didn&#8217;t respond within five seconds, the default timeout period that the Reflector uses for retrieving data.<\/p>\n\n\n\n<p>Now, let&#8217;s break down the main options of the <code>reflector<\/code> command and what each one means.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>--latest<\/code>: Limit the list to the &#8220;<em>n<\/em>&#8221; most recently synchronized servers.<\/li>\n\n\n\n<li><code>--sort<\/code>: In that case, sort the mirrors list by &#8220;<em>rate<\/em>,&#8221; which means the download rate. The other possible options are &#8220;<em>age<\/em>,&#8221; &#8220;<em>country<\/em>,&#8221; &#8220;<em>score<\/em>,&#8221; and &#8220;<em>delay<\/em>.&#8221;<\/li>\n\n\n\n<li><code>--save<\/code>: Save the mirrors list as a file to the given path.<\/li>\n<\/ul>\n\n\n\n<p>We can additionally improve the above command by telling Reflector to pick the five fastest servers from the last ten synchronized mirrors and list them in the &#8220;<em>\/etc\/pacman.d\/mirrorlist<\/em>&#8221; file. To do this, add the <code>--fastest<\/code> option and specify the number of servers you want. The command will look like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo reflector --latest 10 --sort rate --fastest 5 --save \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Let&#8217;s now look at other practical options for the&nbsp;<code>reflector<\/code>&nbsp;command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Selecting Servers From a Specific Country(ies) Only<\/h3>\n\n\n\n<p>A handy feature of Reflector is the ability to test servers only located in a specific country, usually the same country as your Arch system. This means faster performance.<\/p>\n\n\n\n<p>You can do this by using the <code>--country<\/code> option. If you&#8217;re wondering how to find the correct codes for different countries, run the below command, and Reflector will display them.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">reflector --list-countries<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-05.jpg\"><img decoding=\"async\" width=\"962\" height=\"592\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-05.jpg\" alt=\"Country codes.\" class=\"wp-image-122906\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-05.jpg 962w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-05-380x234.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-05-768x473.jpg 768w\" sizes=\"(max-width: 962px) 100vw, 962px\" \/><\/a><figcaption class=\"wp-element-caption\">Country codes.<\/figcaption><\/figure>\n\n\n\n<p>For example, to limit the servers to those located in the US only, you could use this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo reflector --country <span class=\"hljs-string\">\"US\"<\/span> --latest 10 --sort rate --save \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Of course, we can add more countries if we want. Just list them one after the other, separated by commas. Here is an example with the US and Canada.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo reflector --country <span class=\"hljs-string\">\"US,CA\"<\/span> --latest 10 --sort rate --save \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If you want, you can use their full names instead of the country codes:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo reflector --country <span class=\"hljs-string\">\"United States,Canada\"<\/span> --latest 10 --sort rate --save \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Limiting Arch&#8217;s Mirrors by Protocol Used<\/h3>\n\n\n\n<p>Lastly, we&#8217;ll show you how to filter mirror servers based on their protocol. The possible options are &#8220;<em>http<\/em>,&#8221; &#8220;<em>https<\/em>,&#8221; and &#8220;<em>ftp<\/em>.&#8221; You can do this with the <code>--protocol<\/code> option.<\/p>\n\n\n\n<p>For example, here&#8217;s how to test and create a &#8220;<em>mirrorlist<\/em>&#8221; file with only &#8220;<em>https<\/em>&#8221; Arch&#8217;s mirror servers.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo reflector --protocol https --latest 10 --sort rate --save \/etc\/pacman.d\/mirrorlist<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>As with the country&#8217;s code, multiple protocols may be selected using commas (e.g., &#8220;<em>http,https<\/em>&#8220;).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Automating the Process<\/h3>\n\n\n\n<p>It&#8217;s important to realize that the fastest Arch mirror for you today might not be the fastest one tomorrow or next week. The same is true for the frequency of syncs; another mirror might start synchronizing more frequently.<\/p>\n\n\n\n<p>This raises the question of whether you need to run the <code>reflector<\/code> command regularly. The answer is yes. And while this might seem like a tedious chore, there&#8217;s good news.<\/p>\n\n\n\n<p>Reflector includes a feature, a systemd timer, that once set up, will automatically handle this for you. It continually updates the &#8220;<em>\/etc\/pacman.d\/mirrorlist<\/em>&#8221; file, freeing you from running it manually at regular intervals.<\/p>\n\n\n\n<p>New to systemd timers? They are a scheduling tool in Linux, part of the systemd functionality, that triggers events at specified times, <a href=\"https:\/\/linuxiac.com\/how-to-use-cron-and-crontab-on-linux\/\" data-type=\"post\" data-id=\"100157\">similar to a cron job<\/a>. Now, back to the topic.<\/p>\n\n\n\n<p>Reflector uses a configuration file located at &#8220;<em>\/etc\/xdg\/reflector\/reflector.conf<\/em>&#8221; to determine its default settings. Open it using your preferred <a href=\"https:\/\/linuxiac.com\/best-linux-terminal-text-editors-for-beginners\/\">terminal text editor<\/a> and adjust the settings according to your needs.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo nano \/etc\/xdg\/reflector\/reflector.conf<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-06.jpg\"><img decoding=\"async\" width=\"960\" height=\"598\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-06.jpg\" alt=\"Reflector's service configuration file.\" class=\"wp-image-122960\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-06.jpg 960w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-06-380x237.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-06-768x478.jpg 768w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/a><figcaption class=\"wp-element-caption\">Reflector&#8217;s service configuration file.<\/figcaption><\/figure>\n\n\n\n<p>Save the file and exit. Next, to enable Reflector to automatically create the &#8220;<em>mirrorlist<\/em>&#8221; file, run:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo systemctl <span class=\"hljs-built_in\">enable<\/span> --now reflector.timer<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This will activate and start the timer to recreate the &#8220;<em>mirrorlist<\/em>.&#8221; That&#8217;s a weekly timer that calls the reflector service that runs the task itself.<\/p>\n\n\n\n<p>You can check its status by running the command below. In the output, &#8220;<em>reflector.timer<\/em>&#8221; should be present.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo systemctl list-timers<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-08.jpg\"><img decoding=\"async\" width=\"956\" height=\"471\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-08.jpg\" alt=\"Check reflector.timer\" class=\"wp-image-123026\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-08.jpg 956w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-08-380x187.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-08-768x378.jpg 768w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><\/a><figcaption class=\"wp-element-caption\">Check reflector.timer<\/figcaption><\/figure>\n\n\n\n<p>But there&#8217;s an additional option. As we mentioned, Reflector offers its own service besides the systemd timer. If you want your &#8220;<em>mirrorlist<\/em>&#8221; file to be recreated every time your Arch system boots, based on the settings in &#8220;<em>\/etc\/xdg\/reflector\/reflector.conf<\/em>,&#8221; you can run:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">sudo systemctl <span class=\"hljs-built_in\">enable<\/span> --now reflector.service<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-07.jpg\"><img decoding=\"async\" width=\"947\" height=\"122\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-07.jpg\" alt=\"Enable Reflector service.\" class=\"wp-image-122972\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-07.jpg 947w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-07-380x49.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/06\/arch-rank-mirrors-07-768x99.jpg 768w\" sizes=\"(max-width: 947px) 100vw, 947px\" \/><\/a><\/figure>\n\n\n\n<p>This enables and starts the Reflector&#8217;s service and recreates the file immediately.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>With Reflector in your toolkit, managing Arch Linux mirrors becomes easier and downright convenient. This saves you time during updates and enhances your overall user experience. A well-maintained mirror list is key to enjoying the best that Arch has to offer, making each update swift and smooth.<\/p>\n\n\n\n<p>For more information, visit the <a href=\"https:\/\/man.archlinux.org\/man\/reflector.1\" target=\"_blank\" rel=\"noreferrer noopener\">Reflector man page<\/a> or the <a href=\"https:\/\/wiki.archlinux.org\/title\/Reflector\" target=\"_blank\" rel=\"noreferrer noopener\">Arch Wiki<\/a>. Thanks for using our guide! Feel free to share your thoughts in the comments section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Meet Reflector, the Arch Linux tool that optimizes your Pacman experience by selecting the fastest and most up-to-date mirrors. Here&#8217;s how to use it.<\/p>\n","protected":false},"author":10,"featured_media":122540,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4417],"tags":[4264,2015],"class_list":["post-122537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips","category-linux-knowledge","tag-arch-linux","tag-pacman"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/122537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/comments?post=122537"}],"version-history":[{"count":0,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/122537\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media\/122540"}],"wp:attachment":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media?parent=122537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/categories?post=122537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/tags?post=122537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}