Mastodon hachyterm.io

Today I broke my Manjaro system.

I wanted to update my pacman-mirrors and somehow landed on an unstable branch. Usually, I use the stable branch.

I mistakingly used Arch Linux’s Pacman Mirrorlist Generator instead of Manjaro’s mirrors.

I had upgraded my system with: sudo pacman -Syyu.

After a reboot, I encountered many errors: lightdm didn’t work anymore, pacman-mirrors broke, etc.:

ModuleNotFoundError: No module named 'pacman_mirrors'

That was a catch-22 because I couldn’t update my pacman-mirrors. Accordingly, I couldn’t switch to packages from an up-to-date repository/mirror.

What did work: setting Manjaro’s mirrors, downgrading packages, then refreshing pacman-mirrors, and updating the system afterward.

First, I opened the file /etc/pacman.d/mirrorlist. On the website repo.manjaro.org I chose a server, for example manjaro.melbourneitmirror.net. Now, I added it to the mirrorlist:

Server = manjaro.melbourneitmirror.net/stable/$repo/$arch

Now I could run pacman:

sudo pacman -Syyuu
  • S: synchronize local packages with the upstream mirror
  • yy: download the packages from the server even if up to date
  • uu: downgrade the packages

The command reverted all packages to the stable branch.

pacman-mirrors worked again. I made sure to check out the stable branch. Then I updated my mirrorlist with the 5 fastest mirrors and upgraded my system. Now everything is up to date on the stable branch.

sudo pacman-mirrors --api --set-branch stable
sudo pacman-mirrors --fasttrack 5 && sudo pacman -Syyu

Further Reading