Is it normal to use update --force-refresh everytime I want to install something using pamac?

Everytime I try to install to upgrade my system using pamac. It throws and error

Invalid or corrupted database

Even after pacman -Syyu it states the same

But doing a

pamac update --force-refresh

Solves everything but I have to do it every single time after each boot. I do not think this is normal that is why I want to ask this in the forum.

You are right - it is not normal.

Next time you see it - please check the file type of the database files - I think they may be html files or corrupted.

A healthy system returns something like this - there may be more files - e.g. files metadata - at the very least it should return

 $ file /var/lib/pacman/sync/*
/var/lib/pacman/sync/core.db:             gzip compressed data, last modified: Thu May  9 20:29:21 2024, from Unix, original size modulo 2^32 645632
/var/lib/pacman/sync/extra.db:            gzip compressed data, last modified: Fri May 10 23:16:20 2024, from Unix, original size modulo 2^32 34825216
/var/lib/pacman/sync/multilib.db:         gzip compressed data, last modified: Tue May  7 16:28:24 2024, from Unix, original size modulo 2^32 676352

It may be as simple as switching mirror

sudo pacman-mirrors --continent

Running file /var/lib/pacman/sync/*

var/lib/pacman/sync/extra.files:    gzip compressed data, last modified: Fri May 10 23:16:27 2024, from Unix, original size modulo 2^32 478354944 gzip compressed data, reserved method, has CRC, was "", has comment, encrypted, from FAT filesystem (MS-DOS, OS/2, NT), original size modulo 2^32 478354944

I get the above any idea how to remove the last part?

  • 1 - if thats truly your output then you are missing pieces

  • 2 - to trim the print, such as to print the first column:

file /var/lib/pacman/sync/* | awk '{print $1}'
  • 3 - if you want to find files at that location a better command might be find:
find /var/lib/pacman/sync/
find /var/lib/pacman/sync/ -type f

If I know what you mean I may be able to answer - but I do not.

The file command show what kind of file we are looking at.

If they are compressed archives they are probably ok - if they are anything else - they are not.

A complete output from my system which includes my own custom repo and sublime-text repo

.sig files are binary data and is displayed as data

As not everyone has the same data as I do - I shortened my output above - avoid possible confusion and the question - but I do not have … ?

 $ file /var/lib/pacman/sync/*
/var/lib/pacman/sync/core.db:                gzip compressed data, last modified: Thu May  9 20:29:21 2024, from Unix, original size modulo 2^32 645632
/var/lib/pacman/sync/core.files:             gzip compressed data, last modified: Thu May  9 20:29:21 2024, from Unix, original size modulo 2^32 26235904
/var/lib/pacman/sync/extra.db:               gzip compressed data, last modified: Fri May 10 23:16:20 2024, from Unix, original size modulo 2^32 34825216
/var/lib/pacman/sync/extra.files:            gzip compressed data, last modified: Fri May 10 23:16:27 2024, from Unix, original size modulo 2^32 478354944 gzip compressed data, reserved method, has CRC, was "", has comment, encrypted, from FAT filesystem (MS-DOS, OS/2, NT), original size modulo 2^32 478354944
/var/lib/pacman/sync/multilib.db:            gzip compressed data, last modified: Tue May  7 16:28:24 2024, from Unix, original size modulo 2^32 676352
/var/lib/pacman/sync/multilib.files:         gzip compressed data, last modified: Tue May  7 16:28:24 2024, from Unix, original size modulo 2^32 1380352
/var/lib/pacman/sync/nixrepo.db:             Zstandard compressed data (v0.8+), Dictionary ID: None
/var/lib/pacman/sync/nixrepo.files:          Zstandard compressed data (v0.8+), Dictionary ID: None
/var/lib/pacman/sync/sublime-text.db:        gzip compressed data, last modified: Tue May  7 06:57:22 2024, from Unix, original size modulo 2^32 6144
/var/lib/pacman/sync/sublime-text.db.sig:    data
/var/lib/pacman/sync/sublime-text.files:     gzip compressed data, last modified: Tue May  7 06:57:22 2024, from Unix, original size modulo 2^32 16896
/var/lib/pacman/sync/sublime-text.files.sig: data

Invalid or corrupted database files like /var/lib/pacman/sync/extra.db.part
or /var/tmp/pamac/dbs/sync/extra.db.part for pamac

Indeed I don’t :grin:

If one have such partital files - that is not a healthy system