If you’re in a rush and want to fix this problem quickly, just run the below command:
$ sudo pacman-mirrors --continent
$ sudo pacman -Sy
However, I recommend you read the entire article to understand the main reason for this issue and become an informed Linux user.
Are you experiencing SSL certificate issues when trying to retrieve “core.db
“, “extra.db
“, and “community.db
” from the mirror list in your Arch or Manjaro-based distribution?
Before providing the solution, allow me to explain the root cause of the issue you encountered.
- Internet connection and DNS issues
- Faulty or slow mirrors
While there could be various factors at play, these two stand out as the most prevalent. Among them, the second issue (faulty or sluggish mirrors) is the primary culprit in almost all cases.
The Arch or Manjaro-based distributions maintain a mirror list, typically located at “/etc/pacman.d/mirrorlist
“, which serves as a source for fetching package information.
You can conveniently access and read this file using the cat command.
$ cat /etc/pacman.d/mirrorlist
Output:
In the image above, you’ll immediately spot three mirrors stored in my “mirrorlist
” file, all added by default.
While the mirror list generally functions seamlessly, it’s important to note that due to the rolling distribution nature of Arch and Manjaro, unexpected interruptions in the mirror list can occur.
If you’re a Linux user who is facing this issue, take immediate action by following these methods to effectively resolve the problem.
Solution 1: Updating the Mirror List
The most straightforward solution to address this error is by executing one of the following commands, which updates your system mirror list:
#Add almost all the mirrors closest to your location
$ sudo pacman-mirrors --continent
#OR
#Add the three fastest mirrors closest to your location
$ sudo pacman -f3
Output:
When you are done, execute the following command to ensure the issue is resolved:
$ sudo pacman -Sy
Output:
You can verify and inspect the newly added mirrors by examining your “mirrorlist
” file.
$ pacman-mirrors
#OR
$ cat /etc/pacman.d/mirrorlist
Output:
Solution 2: Manually Updating the Mirror List
In the previous solution, the “pacman-mirrors
” command automated most of the work, but it can also be performed manually.
To manually update the mirror list, follow these steps one-by-one:
1. Before proceeding, it’s a good idea to create a backup of your existing mirror list:
$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
Output:
2. Visit the official “Pacman Mirrorlist Generator” page to obtain your preferred mirrors.
3. After choosing your country, protocol, and clicking “Generate List”, you’ll be redirected to a page that looks like the one below.
4. Finally, open your “mirrorlist
” file with your preferred text editor, delete the current mirrors, and replace them with the copied ones above. Remember to remove “#
” in front of mirrors and choose your favorite one to paste instead of using all of them.
$ sudo vim /etc/pacman.d/mirrorlist
Output:
5. Save, close the “mirrorlist
” file, then ensure everything is working perfectly by running:
$ sudo pacman -Sy
Output:
Solution 3: Updating the Mirror List via Reflector
Reflector is a handy tool in Arch and Manjaro-based Linux distributions that can help you easily find the fastest and most up-to-date mirrors for your system.
To install and configure it on your system, simply follow the below steps.
1. Open your terminal and run the following command to install “reflector
“:
pacman-mirrors
” installation, you may be prompted to remove it to prevent conflicts. Just type “y” for yes when prompted or forcefully remove it using the “sudo pacman -Rdd --noconfirm pacman-mirrors
” command (not recommended).$ sudo pacman -S reflector
Output:
2. Before proceeding, it’s a good idea to create a backup of your existing mirror list:
$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
Output:
3. After installing the “reflector
“, you can easily generate a new mirror list, sorted by download speed, and save it to your “mirrorlist
” file. Here’s an illustrative example:
$ sudo reflector --latest 10 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
Output:
The above command breakdown is:
- The “
--latest 10
” will fetch the 10 recently synchronized servers. - The “
--protocol https
” will retrieve HTTPS-enabled mirrors. - The “
--sort rate
” will sort them by download speed. - Lastly, the result will be saved to “
--save /etc/pacman.d/mirrorlist
“.
4. To verify the new mirrors are added to your “mirrorlist
” file, run:
$ cat /etc/pacman.d/mirrorlist
Output:
5. Finally, update the mirror database to start using the new mirrors:
$ sudo pacman -Sy
Output:
Final Word
I hope you find this article useful. If you have any questions or are stuck somewhere, then do let us know via the comment section.
Till then, peace!
Join The Conversation
Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.