Error: could not open endeavouros.db: unrecognized file format

I downloaded EndeavourOS around 2 years ago and haven’t been using it on this laptop for a while, so I expected a few hiccups when upgrading the packages and the overall system. I went down an immense rabbit hole trying to repair my system (learning new vocabulary along the way, since I’m sort of new to Arch), but I’ve come to the point where I feel I’m closer to fixing it. My issues ranged from dead mirrors to the GPGME error after sudo pacman -Syu, a slew of which I would assume I fixed since I don’t see the errors anymore(?) I feel this post’s solution got me really close, but it’s producing the error I’m getting now:

The issue I’m currently facing is right after running sudo pacman -Syu, I would get this error: could not open file /var/lib/pacman/sync/endeavouros.db: Unrecognized archive format and error: failed to prepare transaction (invalid or corrupted database) After some inspection, I realized the file type is HTML, which I’m very confused about.

Please let me know if I need to provide any more information as I’m truly clueless as to the remedy. I’m also trying to avoid flashing another EndeavourOs copy since I’d like to keep the files here. Any and all help is VERY much appreciated! (please let me know if there is some sort of post structure I should adopt given this is my first one)

Try eos-update with options
--clear-databases
and/or
--keyrings-reset

Then update again with eos-update.

And welcome to the community!

I get this output:

eos-update: unrecognized option '--keyrings-reset'
eos-update: unrecognized option '--clear-databases'
...

and I tried eos-update just for the funsies:

:: Synchronizing package databases...
 endeavouros                                                                        1262.0   B  1265   B/s 00:01 [-------------------------------------------------------------------] 100%
 core is up to date
 extra is up to date
 multilib is up to date
error: could not open file /var/lib/pacman/sync/endeavouros.db: Unrecognized archive format
warning: archlinux-keyring-20240709-1 is up to date -- skipping
error: target not found: endeavouros-keyring

This could point to your /etc/pacman.d/endeavouros-mirrorlist not being properly configured.

Try this:

Refresh your mirrrorlist for EnOS. You could refresh your mirrorlist for Arch as well. Won’t hurt.

Remove your sync databases: sudo rm -r /var/lib/pacman/sync/*

Now run: sudo pacman -Syu

If you still get the same error message, post the content of your /etc/pacman.d/endeavouros-mirrorlist.

If you get any other error messages, post them back here.

I ran eos-rankmirrors (assuming that refreshed it, I think) (also, should I use reflector to refresh the arch mirrors specifically?)

after deleting the sync databases, I get the same error message after sudo pacman -Syu:

:: Synchronizing package databases...
 endeavouros                                                                        1262.0   B  1450   B/s 00:01 [-------------------------------------------------------------------] 100%
 core                                                                                118.6 KiB   122 KiB/s 00:01 [-------------------------------------------------------------------] 100%
 extra                                                                                 7.3 MiB  3.72 MiB/s 00:02 [-------------------------------------------------------------------] 100%
 multilib                                                                            137.5 KiB   143 KiB/s 00:01 [-------------------------------------------------------------------] 100%
:: Starting full system upgrade...
error: could not open file /var/lib/pacman/sync/endeavouros.db: Unrecognized archive format
:: Replace amtk with extra/libgedit-amtk? [Y/n] 
:: Replace arb with extra/flint? [Y/n] 
:: Replace dbus-python with extra/python-dbus? [Y/n] 
:: Replace karchive with extra/karchive5? [Y/n] 
:: Replace kauth with extra/kauth5? [Y/n] 
:: Replace kbookmarks with extra/kbookmarks5? [Y/n] 
:: Replace kcodecs with extra/kcodecs5? [Y/n] 
:: Replace kcompletion with extra/kcompletion5? [Y/n] 
:: Replace kconfig with extra/kconfig5? [Y/n] 
:: Replace kconfigwidgets with extra/kconfigwidgets5? [Y/n] 
:: Replace kcoreaddons with extra/kcoreaddons5? [Y/n] 
:: Replace kcrash with extra/kcrash5? [Y/n] 
:: Replace kdbusaddons with extra/kdbusaddons5? [Y/n] 
:: Replace kded with extra/kded5? [Y/n] 
:: Replace kglobalaccel with extra/kglobalaccel5? [Y/n] 
:: Replace kguiaddons with extra/kguiaddons5? [Y/n] 
:: Replace ki18n with extra/ki18n5? [Y/n] 
:: Replace kiconthemes with extra/kiconthemes5? [Y/n] 
:: Replace kio with extra/kio5? [Y/n] 
:: Replace kitemviews with extra/kitemviews5? [Y/n] 
:: Replace kjobwidgets with extra/kjobwidgets5? [Y/n] 
:: Replace knotifications with extra/knotifications5? [Y/n] 
:: Replace kservice with extra/kservice5? [Y/n] 
:: Replace ktextwidgets with extra/ktextwidgets5? [Y/n] 
:: Replace kwallet with extra/kwallet5? [Y/n] 
:: Replace kwidgetsaddons with extra/kwidgetsaddons5? [Y/n] 
:: Replace kwindowsystem with extra/kwindowsystem5? [Y/n] 
:: Replace kxmlgui with extra/kxmlgui5? [Y/n] 
:: Replace solid with extra/solid5? [Y/n] 
:: Replace sonnet with extra/sonnet5? [Y/n] 
:: Replace tepl with extra/libgedit-tepl? [Y/n] 
error: failed to prepare transaction (invalid or corrupted database)

and cat /etc/pacman.d/endeavouros-mirrorlist produces

######################################################
####                                              ####
###        EndeavourOS Repository Mirrorlist       ###
####                                              ####
######################################################
#### Entry in file /etc/pacman.conf:
###     [endeavouros]
###     SigLevel = PackageRequired
###     Include = /etc/pacman.d/endeavouros-mirrorlist
######################################################
### Tip: Use the 'eos-rankmirrors' program to rank
###      these mirrors or re-order them manually.
######################################################

## Canada
#Server = https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch

## China
#Server = https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch
#Server = https://mirrors.jlu.edu.cn/endeavouros/repo/$repo/$arch

## Germany
#Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
#Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
#Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch

## France
#Server = https://endeavour.remi.lu/repo/$repo/$arch
#Server = https://mirror.jordanrey.me/endeavouros/repo/$repo/$arch

## India
#Server = https://mirror.albony.xyz/endeavouros/repo/$repo/$arch

## Moldova
#Server = https://md.mirrors.hacktegic.com/endeavouros/repo/$repo/$arch

## Singapore
#Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
#Server = https://mirror.freedif.org/EndeavourOS/repo/$repo/$arch

## South Korea
#Server = https://mirror.funami.tech/endeavouros/repo/$repo/$arch

## Sweden
#Server = https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
#Server = https://mirror.linux.pizza/endeavouros/repo/$repo/$arch

## Taiwan
#Server = https://mirror.archlinux.tw/EndeavourOS/repo/$repo/$arch

## United States
#Server = https://mirrors.gigenet.com/endeavouros/repo/$repo/$arch


# Results of mirror ranking at (UTC) 08/12/2024 11:34:05 AM:
# The following fields are shown for each mirror:
#   mirror:          The mirror address
#   update-level:    Ordinal number of the latest update (larger is newer)
#   fetch-time:      Measures the speed of the mirror (smaller is faster)
#
# mirror                                                             update-level  fetch-time  
# ~~~~~~                                                             ~~~~~~~~~~~~  ~~~~~~~~~~  
# https://mirror.jordanrey.me/endeavouros/repo/$repo/$arch           <!doctype     html>       0.798593
# https://mirrors.gigenet.com/endeavouros/repo/$repo/$arch           2233          0.268437    
# https://mirror.moson.org/endeavouros/repo/$repo/$arch              2233          0.597413    
# https://mirror.alpix.eu/endeavouros/repo/$repo/$arch               2233          0.614267    
# https://md.mirrors.hacktegic.com/endeavouros/repo/$repo/$arch      2233          0.678013    
# https://mirror.freedif.org/EndeavourOS/repo/$repo/$arch            2233          0.873551    
# https://mirror.archlinux.tw/EndeavourOS/repo/$repo/$arch           2233          0.976367    
# https://mirror.funami.tech/endeavouros/repo/$repo/$arch            2233          1.174083    
# https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch         2233          1.208328    
# https://de.freedif.org/EndeavourOS/repo/$repo/$arch                2233          1.400394    
# https://mirror.jingk.ai/endeavouros/repo/$repo/$arch               2233          1.422831    
# https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch  2233          1.736310    
# https://mirror.albony.xyz/endeavouros/repo/$repo/$arch             2233          1.774637    
# https://mirrors.jlu.edu.cn/endeavouros/repo/$repo/$arch            2233          2.173013    

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# EndeavourOS mirrorlist:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Server = https://mirror.jordanrey.me/endeavouros/repo/$repo/$arch
Server = https://mirrors.gigenet.com/endeavouros/repo/$repo/$arch
Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch
Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
Server = https://md.mirrors.hacktegic.com/endeavouros/repo/$repo/$arch
Server = https://mirror.freedif.org/EndeavourOS/repo/$repo/$arch
Server = https://mirror.archlinux.tw/EndeavourOS/repo/$repo/$arch
Server = https://mirror.funami.tech/endeavouros/repo/$repo/$arch
Server = https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch
Server = https://mirror.albony.xyz/endeavouros/repo/$repo/$arch
Server = https://mirrors.jlu.edu.cn/endeavouros/repo/$repo/$arch
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Looks like you cannot get the proper database for EnOS downloaded from its mirrors :thinking:

For now you may want to update your Arch packages to begin with and later tackle the issue with EnOS.

Comment out EnOS repo in your /etc/pacman.conf.

#[endeavouros]
#SigLevel = PackageRequired
#Include = /etc/pacman.d/endeavouros-mirrorlist

Run the update command and update your Arch packages.

1 Like

Interestingly enough, when I ran the command, all those Arch package updates went through! So, now we should tackle the EnOS packages… Should I uncomment that same section in pacman.conf and update again?

That was sort of the point with that manoeuvre :wink:

Yes.

Then:

  1. remove
/var/lib/pacman/sync/endeavouros.db
  1. update

  2. if still the same issue, remove/comment out the first active mirror in your /etc/pacman.d/endeavouros-mirrorlist

  3. go to 1.

Repeat until the issue is resolved.

1 Like

You are a godsend! It only took 3 iterations for it work! I really appreciate the help.

Some final thoughts: yay also happened to work as well (yay!) Should I do both yay and pacman -Syu weekly to avoid similar issues? Also, do mirrors change status over time (i.e. I have to rerun eos-rankmirrors before updating?)Thanks in advance

Screenshot_20240812_094908

1 Like

Updating your system on a weekly basis is fine.

Archlinux is a fast moving rolling release so you should not let too long a time to pass between updates.

yay is a pacman wrapper with AUR support. That means whatever you could do with pacman you could do with yay and some more. You could use it to manage packages from the repoos that are specified in your /etc/pacman.conf and also those from AUR.

With pacman you could only manage the packages from the repos specified in /etc/pacman.conf.

It could happen, however not that frequent, that some mirrors are not “active” for various reasons.

You woudln’t need to refresh your mirrors before each updates. Only when you have some issues like low download speed, some mirrors being out of order etc. which may cause issues for you to update your system, you could try refreshing the mirrors.

1 Like

Exactly what i do! :wink:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.