You are not logged in.

#1 2019-11-04 08:49:35

AuthenticPinguin
Member
Registered: 2019-11-04
Posts: 3

[SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

Hello!
This is my first post here. Im a newby. I am also quite new to Linux in general. But I love it. I read the rules and I will try to be as formal and precise as possible here.
So I have some troubles with pacman 5.2.0-2.
When I try pacman -Syu, I get:

                   error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
                   error: failed to prepare transaction (invalid or corrupted database)

I also have troubles with yay. When I want yay to upgrade I get:

                   yay: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory

I guess, these problems might be related (at least distanlty). Because all of these errors occurred after I reinstalled yay, upgraded pacman and reinstalled yay.
It could very well be that I somehow messed it all up. I tried quite some things but actually I do not remember in detail what I did... Ups.

Could anyone help me with this?

Thanks!

Last edited by AuthenticPinguin (2019-11-05 15:20:17)

Offline

#2 2019-11-04 11:23:26

Morganamilo
Member
Registered: 2017-12-05
Posts: 72

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
                   error: failed to prepare transaction (invalid or corrupted database)

There's more output than this I assume? You should post the full thing.

Try upgrading with -Syyu. If that still does not work, switch mirrors and upgrade with -Syyu again.
If this error happens before it even attempts to download the databases, try deleting  /var/lib/pacman/sync/*.db
then upgrading.

For yay you can search these forums or the github issues.

Offline

#3 2019-11-04 13:20:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,272
Website

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

AuthenticPinguin wrote:

... these errors occurred after I reinstalled yay, upgraded pacman and reinstalled yay.

Do you mean you did a full system upgrade using pacman, or did you just upgrade pacman?

In addition to the complete command and output requested above, also please post your complete pacman.log (in code tags).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2019-11-04 15:31:34

AuthenticPinguin
Member
Registered: 2019-11-04
Posts: 3

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

Morganamilo wrote:

Try upgrading with -Syyu.

Thanks! That worked! Pacman looks fine again.
But I still have problems with yaourt. I have been searching around, also in the forum, like you recommended.
I tried this: https://bbs.archlinux.org/viewtopic.php?id=250233
But I run into troubles because of this:

 git clone https://aur.archlinux.org/yay.git
fatal: destination path 'yay' already exists and is not an empty directory. 

If I just go on and ignore this and go on like this:

 cd yay 
makepkg si-
 ==> WARNING: A package has already been built, installing existing package...
==> Installing package yay with pacman -U... 
loading packages...
warning: yay-9.2.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) yay-9.2.1-1

Total Installed Size:  6.32 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                      [###########################] 100%
(1/1) checking package integrity                    [###########################] 100%
(1/1) loading package files                         [###########################] 100%
(1/1) checking for file conflicts                   [###########################] 100%
(1/1) checking available disk space                 [###########################] 100%
:: Processing package changes...
(1/1) reinstalling yay                              [###########################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate... 

Then I am not able to update yaourt:

yay: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory

So that brings me again to the same errors.... I guess that I installed the old version of yay again right))? At least the same problem remains.
Do you know what I should do next?
Thanks again for your help

Offline

#5 2019-11-04 15:35:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,272
Website

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

You keep saying yaourt.  Are you trying to install yay to install yaourt?  That'd be ... ridiculous.

 ==> WARNING: A package has already been built, installing existing package...

This is pretty clear.  As you have the previously used directory already there, yay was not rebuilt.  Read makepkg's man page for the proper solution.  If this is unclear to you, you should not be using any AUR helper yet.  They are intended to help by automating tedious steps that the user could readily do, not to replace your understanding of what the steps are.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2019-11-04 15:38:40

chrisjbillington
Member
Registered: 2018-11-26
Posts: 15

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

This often occurs when running `pacman -Sy` to update the database, when you are on a wifi network that requires a login in a web interface. The database update request gets intercepted by the network's captive portal, and a login page gets downloaded instead of the database. You can confirm whether this is what happened by taking a look at the database: `head /var/lib/pacman/sync/multilib.db`. Does the file look like HTML for a login page? If so - a captive portal intercepted the database download.

Solution for now (whether a captive portal was the cause or not) is to run `pacman -Sy` again once your network is functioning correctly.

To prevent the issue from occurring again, for me I uninstalled gnome-software, which was causing it. gnome-software was updating the database at startup, which was often before I had logged into the wifi, so resulted in a borked database download.

In the even longer term, I would like to see the database downloads move to HTTPS. I know everything is signed so MITM attacks cannot actually put 3rd-party-injected code on my computer, but HTTPS solves the above problem as well, it can refuse to download unless it is verifiably connected to the server it expects. And further off topic, but unencrypted HTTP downloads mean anyone can see what repos I'm syncing and what packages I'm downloading - this can be used to construct a fingerprint that could be used to track an individual. Better to just move to encrypted transport for everything.

Offline

#7 2019-11-04 20:28:55

AuthenticPinguin
Member
Registered: 2019-11-04
Posts: 3

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

Trilby wrote:

You keep saying yaourt.  Are you trying to install yay to install yaourt?  That'd be ... ridiculous.

 ==> WARNING: A package has already been built, installing existing package...

This is pretty clear.  As you have the previously used directory already there, yay was not rebuilt.  Read makepkg's man page for the proper solution.  If this is unclear to you, you should not be using any AUR helper yet.  They are intended to help by automating tedious steps that the user could readily do, not to replace your understanding of what the steps are.

chrisjbillington wrote:

This often occurs when running `pacman -Sy` ...

Hej! So, I read up on the makepkg's man page and then installed yay correctly! Thanks for your help people!

Offline

#8 2019-11-05 07:10:32

xse
Member
Registered: 2019-01-08
Posts: 29

Re: [SOLVED] /var/lib/pacman/sync/multilib.db: Unrecognized format

Sweet! Think about tagging your thread's topic with something like [solved] smile
Have a good day!


Carefully explaining your problem is half the solution.

Online

Board footer

Powered by FluxBB