Error: Failed to prepare transaction: invalid or corrupted database - existing solutions exhausted

I marked a few that made sense with

Then I deleted 282 packages with

What should I do next?

Pacnews if not yet handled.


sudo pacman -Syu meld
DIFFPROG=meld pacdiff -s 


sudo pacman -Syu manjaro-pacnew-checker

In both cases its still the same idea - compare the new contents to your existing configs and merge the relevant parts. Its difficult to give guidance because its as variable as the files on your system. Do watch out for passwd or shadow files … and if in doubt … you can always skip (s in pacdiff) the pacnew and it will still be there when you next run the checker/pacdiff.

When thats done … I guess I will include installing the install-grub script which will keep your bootloader up to date, and rebuilding the initramfs and modules, etc (there was a mkinitcpio pacnew, right?);

sudo pacman -Syu install-grub
sudo mkinitcpio -P 
sudo grub-mkconfig -o /boot/grub/grub.cfg

I’m in the process of going through pacdiff. I left my own grub config, which included things like encrypted disk uuid (used the R option), I think I handled passwd properly, too.
How should I approach pacman.conf? In terms of meaningful diffs, the pacnew version doesn’t have those lines:

SigLevel = PackageRequired
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

SigLevel = PackageRequired
SigLevel = PackageRequired

Should I just allow the config from pacnew (O) as it is more up to date?

I think you mixed those up.

The upstream defaults now dont have the sig lines.

And the [community] section should be removed entirely.

And when it is done you may want to do your resync/update;

sudo pacman -Syu


pamac update --force-refresh

Alright, I’m done with those. I wasn’t really sure about /etc/pam.d/sddm so I skipped it for now. pamac update --force-refresh came back empty again, sudo pacman -Syu worked fine.

I guess we wont know for sure about the title issue being resolved until you have to update AUR packages again.

This might need to be handled as … well, if its wrong SDDM might not work and you need that for signing in and starting the desktop.

Should I go with overwrite then?


auth        include     system-login
-auth       optional
-auth       optional

account     include     system-login

password    include     system-login
-password   optional    use_authtok

session     optional          force revoke
session     include     system-login
-session    optional    auto_start
-session    optional         auto_start

auth		include		system-login
auth		optional
account		include		system-login
password	include		system-login
session		include		system-login
session		optional auto_start

In this case it really is just extending the functionality. The new file includes the current configs and adds things like gnome_keyring. So yes, it would be totally fine to simply overwrite the exisitng file with the pacnew.

Thank you, done :slight_smile: And ran the update commands

pamac update --force-refresh
❯ pamac update --force-refresh
Synchronizing package databases...
Refreshing core.db...                                                                                                                                                                                               
Refreshing extra.db...                                                                                                                                                                                              
Refreshing multilib.db...                                                                                                                                                                                           
Refreshing core.files...                                                                                                                                                                                            
Refreshing extra.files...                                                                                                                                                                                           
Refreshing multilib.files...                                                                                                                                                                                        
Refreshing AUR...                                                                                                                                                                                                   
Nothing to do.                                                                                                                                                                                                      
Transaction successfully finished.
❯ sudo pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
:: Starting full system upgrade...
 there is nothing to do

What should I do next?

I think you are … done?

As long as you have all the packages you need and no mistakes were made … reboot?

If you want to be extra careful you can use the mapare script to print the manjaro kde profiles package list against your current one.

This command will source the script from gitlab, and is non-destructive. It will make no changes to the system.

bash <(curl -s -IP

Input your desktop at the prompt (kde).
It should print any packages that are included in the default profile that you do not have.
Inspect the output and optionally install any packages that you find necessary.

Again, this should not be a requirement but is a step you could take to make sure you did not accidentally remove or otherwise miss any important packages.

As for the title issue … it may be fixed, but we may not know for sure until your next interaction with the AUR and/or upgrade.


If you want some extra advice … I might suggest using another aur helper like yay or paru over pamac. I would suggest pacman over pamac as well for repo packages, but many problems can be avoided by simply not using the AUR with pamac. :slight_smile:

1 Like

I’m really anxious about rebooting after the grub reinstall :sweat_smile:

That script printed a few missing packages:

bash <(curl -s -IP
❯ bash <(curl -s -IP

 Manjaro Package Restore

 Retrieve and reinstall package lists

 Please provide desktop environment (kde,xfce,gnome): kde

 Packages for installation:

amd-ucode 20240220.97b693d2-1
exfatprogs 1.2.2-1
glibc-locales 2.39-1.1
memtest86+-efi 7.00-1
nano-syntax-highlighting 2020.10.10+10+g1aa64a8-2
xl2tpd 1.3.18-1
networkmanager-l2tp 1.20.12-1
manjaro-gstreamer 20221002-1
liblc3 1.0.4-1
libmysofa 1.3.2-1
pipewire-audio 1:1.0.3-1
pipewire-alsa 1:1.0.3-1
pipewire-pulse 1:1.0.3-1
manjaro-pipewire 20231009-1
phonon-qt5-vlc 0.12.0-2
grub-btrfs 4.13-1
adobe-source-sans-fonts 3.052-1
adobe-source-han-sans-jp-fonts 2.004-2
adobe-source-han-sans-kr-fonts 2.004-2
adobe-source-han-sans-cn-fonts 2.004-2
pamac-gtk3 10.6.0-3
libpackagekit-glib 1.2.8-2
packagekit 1.2.8-2
packagekit-qt5 1.1.1-1
libkcompactdisc 23.08.5-1
audiocd-kio 23.08.5-1
kgamma 5.27.11-1
xorg-xwayland 23.2.6-0
plasma-wayland-session 5.27.11-1
plasma-browser-integration 5.27.11-1
bolt 0.9.7-1
plasma-thunderbolt 5.27.11-1
breeze-gtk 5.27.11-1
plymouth-theme-manjaro 2.2-1
plasma-systemmonitor 5.27.11-1
neofetch 7.1.0-2
plymouth-kcm 5.27.11-1
libva-mesa-driver 1:24.0.2-1
power-profiles-daemon 0.20-1

Does it make sense to (is there any risk in) just install them all? :thinking:

I might suggest using another aur helper like yay or paru over pamac .

tbh I was sure that yay is used under the hood, I have no idea how I ended up with pamac.

And one more question - a lot of AUR-installed packages are now shown as foreign in the “update” UI:

This means they won’t be tracked for updates, right? Is there any simple way to get them back to be tracked by any aur helper?

It would appear you are not using pipewire. I have no idea if this is good or not.

If you wish to switch then install the metapackage

sudo pacman -Syu manjaro-pipewire

But you may want to leave that for now.

There are also a few packages that I dont know if they apply to you - like amd-ucode which is microcode for amd cpus. It similarly appears as if most wayland things are removed. And again for plymouth (boot splash) or at least some associated packages if not plymouth itself. Again I dont know if this is purposeful or not - I remove plymouth.

breeze-gtk makes sense to have installed if you use breeze for QT and want your GTK apps to match.

libva-mesa-driver you almost definitely want though. Its VAAPI which is the most widely used hardware acceleration api.

It wont technically be a big problem having multiple. You could have an extra as a backup for the odd reason. But it makes sense to stick with one because they may use a database to keep track of packages, especially git ones. I know for example paru works this way, so when it is newly adopted it makes sense to feed all foreign packages to it like (and always make sure to update repo packages first);

sudo pacman -Syu
paru -Sa $(pacman -Qmq)

Which is also similarly what you might want to do for pamac’s amnesiatic output.

pamac build $(pacman -Qmq)

(or somehow otherwise rebuild the packages, such as by searching in the interface)

pamac is the default package manager (and aur helper) on manjaro. It uses its own libs. It aims to eventually not even be ALPM (whats under pacman), but as of now it still uses parts of it.
But pamac is not a frontend for pacman or another AUR helper.
octopi is a gui application that is a frontend for pacman and yay.


I left out pipewire and removed some conflicting packages. Now I’m trying to achieve the second part - un-orphan the packages. I tried this

but there are a few missing (as you pointed out earlier):

Error: target not found: manjaro-firmware
Error: target not found: systemd-fsck-silent
Error: target not found: oh-my-zsh
Error: target not found: breath2-wallpaper
Error: target not found: arduino-beta-bin
Error: target not found: manjaro-documentation-en

So I decided to try one by one. I started with pamac build pycharm-professional. It took a while (downloaded the package) but PyCharm works and my settings are preserved. However, it is still listed as foreign:

❯ pacman -Qmq | grep pycharm

despite being on pamac list:

❯ pamac list | grep pycharm
pycharm-professional                         2024.1.1-1                 AUR       2,8 GB

I guess with this config I will need to manage AUR packages updates via pamac update instead of using the UI?

These are ‘super-aliens’ like mentioned before - they do not exist in the repos or the AUR and should really be removed.
If for some reason you think you need some of them - search for a replacement that does exist in the repos or the AUR.

This is an approach that should work.
Every ‘update’ would be doing the same thing - parsing the PKGBUILD.

But it must be noted here that what pacman and pamac are calling foreign maye be different things.

After the rebuild check pamacs output and see where it is listed.

pacman cannot interact with the AUR so anything not in the repos is ‘foreign’ to it.
pamac can interact with the repos, AUR, flatpak, snap … it calls things not found in any of those ‘foreign’.

Wait a tic. :stuck_out_tongue:

Looking at the screenshot again its listing those ‘foreign’ packages as AUR (under the description).
So based on that it would appear it already recognizes them?

You must forgive me for being unwieldy here. I do not use pamac. :slight_smile:

I re-built all aur packages with pamac build, then crossed my fingers and rebooted. It looks like everything works fine now (despite a mini heart attack when after entering the disk encryption key some error showed for like 20 secs), including grub and re-built packages (as in nothing is logged out, my PyCharm still has all the settings, spotify and slack logged-in)!
From now on I’ll be probably using pamac to update AUR packages but whenever I need to re-setup my system I’ll probably just go with yay and not let the UI manage AUR. Let’s see if this works as soon as any package gets an update available :sunglasses:

Thank you so much @cscs, you saved my system :superhero:

From experience Pamac is unreliable with AUR, just use yay, it works. I would advise to disable AUR in Pamac, and separate the AUR updates from the system updates. Just use yay to check for AUR updates after you have updated the system with pacman or Pamac to check for AUR updates.

I think [amended: ONE] problem for Stable repo users right now who want to build stuff from AUR is that with Stable being so behind the current Arch package versions, it may be that AUR stuff that is current with Arch is too ahead of Manjaro Stable to be built at the moment.

1 Like

Yes, that’s a given, you should be on Unstable branch, or even maybe Testing if you use the AUR. Stable users should not use the AUR. But I’m speaking in general, Pamac just has issues with the AUR lot of times, just for the simple process of having an up to date AUR database, just for the simple basic task I had too much issues with.

Do they share the db? Can I just use yay to update packages built with pamac?

Do you recommend to just sudo pacman-mirrors --api --set-branch unstable and keep it this way to avoid issues with non compatible versions?

That’s literally what I recommended you to do. Try yay -Syu

No, I don’t recommend that, that’s what you should do. But then, using Unstable branch has its own caveats, you need to be able to go around potential issues arising from being on Unstable (personally very rarely had issues, just follow the Unstable update thread for known issues). Remember using the AUR is unsupported, the AUR assumes you are on par with Arch Linux, so for Manjaro to be on Unstable branch.

1 Like