Friday, July 23, 2021

Arch Linux How to fix "Unrecognized archive format"

 I went to update my Arch Linux installation this morning, and got this error:


danson@deadlock:$ sudo pacman -Syu

:: Synchronizing package databases...

 core                614.0 KiB  1438 KiB/s 00:00 [-------------------------------] 100%

 extra               614.0 KiB  1498 KiB/s 00:00 [-------------------------------] 100%

 community           614.0 KiB  1204 KiB/s 00:01 [-------------------------------] 100%

:: Starting full system upgrade...

error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format

error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format

error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format

 there is nothing to do


After a bit of research, it turns out there is some problem with the mirror list. The list is stored in /etc/pacman.d. The fix is to "simply" generate a new mirror list. A little more research led me to


which is a web page that will generate a new mirror list for you. Uncomment the lines you like, then save it to /etc/pacman.d/mirrorlist, overwriting your old mirrorlist file. 

Next, delete the .db files from /var/lib/pacman/sync, then run

pacman -Syyu

and new .db files will be generated and the system update should work fine.

2 comments:

Anonymous said...

Thanks for the instructions. Helped me finally update my system.

Oleksandr said...

Thank you. Saved my homeserver.