How to recover Manjaro after a package upgrade broke the system?

Hello there, I have recently tried to install a package gdb but it won't run and displayed an error like this: ** error while loading shared libraries: libffi: cannot open shared object file: No such file or directory .** It was then I decided to install the dependency without updating the system too and everyting stopped working. Here is my pacman.log:

[2020-06-29T00:45:39+0100] [ALPM-SCRIPTLET] ==> Updating trust database...
[2020-06-29T00:45:39+0100] [ALPM-SCRIPTLET] gpg: next trustdb check due at 2020-10-17
[2020-06-29T00:45:40+0100] [ALPM] transaction completed
[2020-06-29T00:45:40+0100] [ALPM] running '30-systemd-update.hook'...
[2020-06-29T00:47:32+0100] [ALPM] transaction started
[2020-06-29T00:47:32+0100] [ALPM] installed source-highlight (3.1.9-2)
[2020-06-29T00:47:32+0100] [ALPM] installed guile2.0 (2.0.14-4)
[2020-06-29T00:47:32+0100] [ALPM] installed gdb-common (9.2-1)
[2020-06-29T00:47:32+0100] [ALPM] installed gdb (9.2-1)
[2020-06-29T00:47:32+0100] [ALPM] transaction completed
[2020-06-29T00:47:33+0100] [ALPM] running '30-systemd-update.hook'...
[2020-06-29T00:47:33+0100] [ALPM] running 'texinfo-install.hook'...
[2020-06-29T00:53:37+0100] [PACMAN] Running 'pacman -S libffi'
[2020-06-29T00:53:40+0100] [ALPM] transaction started
[2020-06-29T00:53:40+0100] [ALPM] upgraded libffi (3.2.1-4 -> 3.3-3)
[2020-06-29T00:53:41+0100] [ALPM] transaction completed
[2020-06-29T00:53:41+0100] [ALPM] running '30-systemd-update.hook'...
[2020-06-29T00:53:41+0100] [ALPM] running 'texinfo-install.hook'...

When I rebooted the system, the screen would run down with a bunch of logs. A picture below:

I have accessed my Manjaro logs from my Kali as I have a dual boot. Is there a way I could update my Manjaro or reverse the latest transaction maybe? Thank you for your help; I really appreciate it.

When did you last time update your system before installing gdb? Whenever you install a new package use -Syu to ensure all packages are updated, otherwise you risk to break your system.

In your case I would try to boot into a Manjaro live ISO and use manjaro-chroot -a to chroot into your system and then to run sudo pacman-mirrors -f && sudo pacman -Syyuu. Afterwards exit chroot and reboot.


Last time I updated was about a month ago, (only because of slow net), I would try this now, thank you very much for your help, sir.

I have managed to fix the problem following your instructions, thank you.

As I have a bad net and the update would take some time, I just downgraded the libffi, and It fortunately worked. No pacman -S for this guy with updating anymore. Thank you again.


Forum kindly sponsored by