Pacman fails with "mirrorlist could not be read" despite file existing (Manjaro 6.12.19-1, KDE Plasma)

When running sudo pacman -Syu, I get:

error: config file /etc/pacman.d/mirrorlist  # ← Critical line (NO trailing #!) could not be read: No such file or directory

The mirrorlist file exists and contains valid mirrors (see below).
Mirrorlist Contents

# Manjaro Linux default mirrorlist  
# Generated on 2025-04-03  
Server = https://ftp.lysator.liu.se/pub/manjaro/stable/$repo/$arch  
Server = https://ziply.mm.fcix.net/manjaro/stable/$repo/$arch  
... (other mirrors)  

I tried regenerating mirrors, verified file permissions -rw-r--r-- 1 root root(644) and also reinstalled pacman and mirrorlist. No effect.

System Information

OS: Manjaro Linux (stable) x86_64  
Kernel: 6.12.19-1-MANJARO  
Desktop: KDE Plasma 6.3.3  
Host: Dell Inspiron 15 3511 (UEFI v1.28.0)  

CPU: 11th Gen Intel Core i5-1135G7 (8) @ 4.20GHz  
GPU: Intel Iris Xe Graphics (Tiger Lake GT2)  
RAM: 8 GiB  

Storage:  
  - NVMe: WD PC SN530 256GB (LUKS-encrypted ext4 root)  
  - Usage: 102.78 GiB / 238.47 GiB (43%)  

Network:  
  - Wireless: Realtek RTL8821CE  
  - Bluetooth: Realtek Bluetooth Radio  

Audio: Intel Tiger Lake-LP Smart Sound Audio  

Packages:  
  - Pacman: 6.1.0  
  - Flatpak: 21  

What could prevent pacman from reading a valid mirrorlist?

A mirror list generated by pacman-mirrors

Default mirror list header

 $ cat /etc/pacman.d/mirrorlist 
##
## Manjaro Linux default mirrorlist
## Generated on 2025-04-05 07:43
##
## Please use 'pacman-mirrors -f [NUMBER] [NUMBER]' to modify mirrorlist
## (Use 0 for all mirrors)
##

## Country : Germany
Server = https://manjaro.kurdy.org/unstable/$repo/$arch

[...]

Custom mirror list header

 $ cat /etc/pacman.d/mirrorlist 
##
## Manjaro Linux custom mirrorlist
## Generated on 2025-04-03 12:43
##
## Please use 'pacman-mirrors -id' To reset custom mirrorlist
## Please use 'pacman-mirrors -c all' To reset custom mirrorlist
## To remove custom config run  'pacman-mirrors -c all'
##

## Country : Austria
Server = https://mirror.easyname.at/manjaro/unstable/$repo/$arch

[...]

If the mirrorlist has been edited using a GUI editor, a byte-order-mark (BOM) may have been added to the beginning of file. The byte-order-mark is a non printable character but pacman will see it and refuse to run.

The nano editor will reveal the invisible char - remove it and save the file

Or rebuild the mirror list

sudo pacman-mirrors --continent
2 Likes