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?


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.

  • 2
    All you need to do is run pkg update -f. No requirement to remove /var/cache/pkg/*. – Zilinski Mar 12 '18 at 3: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 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.