Home | News | Download | Packages | Forum | Wiki | Github

[Resolved] Changed my official repo; how to fix hash mismatch error when using xbps-pkgdb -a?


#1

I changed my official void repo to a location near me

echo "repository=<repo_url>" > /usr/share/xbps.d/00-repository-main.conf

But now running the command xbps-pkgdb -a gives a hash mismatch error.

ERROR: xbps: hash mismatch for /usr/share/xbps.d/00-repository-main.conf.
ERROR: xbps: files check FAILED.

How do I resolve the hash so xbps knows I changed it?


#2

man xbps.d

The configuration directory, by default set to /etc/xbps.d
overrides settings from files available in the system configuration
directory, by default set to /usr/share/xbps.d.

Use the same filename in /etc/xbps.d.
https://www.voidlinux.eu/faq/#changing-mirrors


#3

Thanks - looks like I edited the wrong file.

Was able to resolve hash error by reverting the file back to the original.

echo 'repository=https://repo.voidlinux.eu/current' > /usr/share/xbps.d/00-repository-main.conf && touch -mt 201704130835.21 /usr/share/xbps.d/00-repository-main.conf


#4

I wanted to follow up real quick, in case someone else finds this thread upon running into the same problem (as I did).

After changing the file /usr/share/xbps.d/00-repository-main.conf back to its original format of containing just

repository=https://repo.voidlinux.eu/current

and a new line, I was getting mtime mismatches (instead of hash mismatches). I forget the precise phrasing, but something to the effect that the registered mtime was say 1492072521 vs the current mtime reading of 1514643346.

Those are apparently second counts from the beginning of the Unix epoch, and to extract the date for feeding into ‘touch’ I used

date -d “@1492072521


This must be obvious to mostly everyone around here, but it wasn’t to me… Anyway, no more errors afterwards.