Pacman error: failed to prepare transaction (invalid or corrupted database)

Out of sudden, pacman cannot update my system today. Tried update both reflector and eos-rankmirror. Tried “sudo pacman -Syyu”, Tried “sudo pacman -Sc”. Tried to find similar issue in forum. What can I do?

----------------end---------------
[v@t14s-eos ~]$ sudo pacman -Syu
[sudo] password for v: 
:: Synchronising package databases...
 endeavouros is up to date
 core is up to date
 extra is up to date
 multilib is up to date
:: Starting full system upgrade...
error: could not parse package description file 'haskell-hslua-module-text-1.1.0.1-24/desc' from db 'extra'
error: failed to prepare transaction (invalid or corrupted database)
[v@t14s-eos ~]$ 
----------------end---------------

Solved! Fixed by removing the first mirror in the mirror-list, which was a repo in Singapore

## Singapore
Server = https://sg.mirrors.cicku.me/archlinux/$repo/os/$arch

After removed it, with a Japanese repo on top, Pacman is alive again.

You need to update your mirror list. You can use reflector-simple to do that.

EDIT: Mark your reply as the solution for someone else to find it.

The Singapore repo is made the top rank by the reflector-simple. How can we get alert in advance if the repo is having problem like this?

There is no pre-warning system for repo servers. The best practice is to update your mirror list once a week. And I recommend you avoid Singapore, India, and Thailand. German servers tend to be superior from my experience.

EDIT: You can automate the mirror ranking using Systemd. Look at this wiki post.

2 Likes

Thank you so much.

Thanks for this comment!
[semi OT]:
Would you say that’s ok or even recommended to automate mirror-updates on a system?

I’ve done it on my system. And I casually manually update the mirrors too.

1 Like

so the automatic interval is greater than the said one week?

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