Terminating pkg while packagesite.txz is partially downloaded makes it impossible to install packages
I made the mistake of Ctrl-C'ing pkg while it was downloading packagesite.txz, and now I get the following if I try to install a package:
# pkg install -y irssi
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
irssi: 1.0.5,1
Number of packages to be installed: 1
The process will require 2 MiB more space.
488 KiB to be downloaded.
[1/1] Fetching irssi-1.0.5,1.txz: 100% 488 KiB 62.4kB/s 00:08
pkg: cached package irssi-1.0.5,1: size mismatch, fetching from remote
[1/1] Fetching irssi-1.0.5,1.txz: 100% 488 KiB 83.2kB/s 00:06
pkg: cached package irssi-1.0.5,1: size mismatch, cannot continue
The issue will persist until a new packagesite.txz is updated upstream, at which point it will re-download a new copy.
pkg update -f is likely to help meanwhile.
A new wrinkle: I got into this state when I tried a pkg add on a system whose OSVERSION did not match the most recent binary packages. I had to do a "pkg -o OSVERSION=blah update -f" to get out of that state.
I'm not sure what the proper thing to do in this case is, but leaving the repo in a state where it believed it had the latest packagesite.txz when it didn't was clearly not correct.
See also:
- #1956