4

I have been installing FreeBSD 12.0-CURRENT in a new desktop.

I lost the wifi connection while updating the system.

After that, trying to install aterm with the command:

sudo pkg install aterm

I got the following errors:

Proceed with this action [y/N]: y
Fetching aterm-1.0.7.txz: 0% of 70 KiB                                                                                 
pkg: cached package aterm-1.0.7: size mismatch, fetching from remote
Fetching aterm-1.0.7: 0% of 70 KiB                                                                                 
pkg: cached package aterm-1.0.7: size mismatch, cannot continue

I have noticed it does not work when installing other packages too.

What to do?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227

1 Answers1

7

It seems this is some sort of corruption of the packages cache.

To solve it I did:

sudo pkg clean
sudo rm -rf /var/cache/pkg/*
sudo pkg update -f

After that, I was able to install packages again.

I based myself on this thread from the FreeBSD forums pkg 1.3.0: size mismatch cannot continue with a similar problem.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
  • 2
    All you need to do is run `pkg update -f`. No requirement to remove `/var/cache/pkg/*`. – Zilinski Mar 12 '18 at 03:09
  • Unfortunately I do not remember the specifics after all this time; I had serious problems dealing with that corruption case, and only deleting the directory seemed to fix it. – Rui F Ribeiro Mar 12 '18 at 09:58