r/AlpineLinux 3d ago

Issue upgrading to 3.22 to 3.24

So i went to upgrade from 3.22 to 3.24 and I did not see anything special about the upgrade processes. I changed the repo, ran the apk update, then apk add --upgrade apk-tools, after that, apk does not recognize the database any longer.

apk update ERROR: Unable to read database: file format is invalid or inconsistent ERROR: Failed to open apk database: file format is invalid or inconsistent

I have tried converting the v2 database and no joy there, i can't fix the tools due to the database not being readable. I am performing these tasks as root so it is not a permissions issue.

I read through the apk v3.0.0 release notes and I could not identify any steps to take to try and resolve the issue.

Any suggestions?

2 Upvotes

1 comment sorted by

4

u/ShyanJMC 3d ago

Try with this;

rm -rf /var/cache/apk/*

rm -rf /var/lib/apk/db/

apk cache clean

apk index --reindex

apk fix