pkg 1.3.0: size mismatch cannot continue

BSDBernd

Active Member

Reaction score: 18
Messages: 147

Hi,

I use FreeBSD 10.0-RELEASE-p7 and tried to install vim using pkg, which is now version 1.3.0, and got the following:

Code:
fbsd_home:~ bernd$ sudo pkg install vim
Updating repository catalogue
pkg: http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/meta.txz: Not Found
pkg: repository FreeBSD has no meta file, using default settings
FreeBSD repository catalogue is up-to-date, no need to fetch fresh copy
The following 4 packages will be affected (of 584 checked):

New packages to be INSTALLED:
	vim: 7.4.364
	lua52: 5.2.3_2
	ctags: 5.8
	cscope: 15.8a

The process will require 29 MB more space
6 MB to be downloaded

Proceed with this action [y/N]: y
Fetching vim-7.4.364.txz: 100% of 6 MB                                                                                 
pkg: cached package vim-7.4.364: size mismatch, fetching from remote
Fetching vim-7.4.364.txz: 100% of 6 MB                                                                                 
pkg: cached package vim-7.4.364: size mismatch, cannot continue


A new warning that comes with the new version of pkg seems to be that a metafile is missing.
But that aside, what explains the message in the last line of the code presented above? Why doesn't the installation work?

Thank you for any answer....
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,783
Messages: 34,911

BSDBernd said:
I use FreeBSD 10.0-RELEASE-p7 and tried to install vim using pkg, which is now version 1.3.0,
It received a few updates in the meantime. It's now at 1.3.3 ;)

You may want to try and update pkg first. There were some issues with 1.3.0.
 
OP
BSDBernd

BSDBernd

Active Member

Reaction score: 18
Messages: 147

Thank you for your answer. I updated the package manager to version 1.3.4 now and got the exact same messages.
What else could have went wrong?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,783
Messages: 34,911

Yeah, I've had some struggles with pkg too. The transition from 1.2.x to 1.3.x wasn't easy. You can try any one of these:
Code:
pkg clean # cleans /var/cache/pkg/
rm -rf /var/cache/pkg/* # just remove it all
pkg update -f # forces update  of repository catalog
rm /var/db/pkg/repo-*.sqlite # removes all remote repository catalogs
pkg bootstrap -f # forces reinstall of pkg

You can delete quite a lot but whatever you do, do NOT delete /var/db/pkg/local.sqlite. It contains the database with your installed packages. If you remove it the system will think you have nothing installed.
 

hyperrealx

New Member

Reaction score: 1
Messages: 3

BSDBernd said:
Thank you very much for your help!
The following one of your suggestions did it :). I successfully installed vim.
Code:
sudo pkg update -f 

I just want to verify that this solved my issue as well. Thank you.
 

iBookG4

New Member


Messages: 11

Ditto. Had issues installing vim, and sudo pkg update -f fixed it. Thanks very much.
 

xchris

Member

Reaction score: 15
Messages: 80

f*** unbelievable its 2018 and still I had the same issue trying to install vim!
 

ILUXA

Aspiring Daemon

Reaction score: 554
Messages: 743

It is not an issue, you just need to use # pkg update,
to update the local copy of the repository, your local copy is just too old
and you get "package size mismatch".
Use # pkg update -f, to be sure. In my experience,
sometimes # pkg update -f is also required after ports-mgmt/pkg upgrade.
 

xchris

Member

Reaction score: 15
Messages: 80

I know... the strange thing is that happened with vim package only.
 

elgrande

New Member

Reaction score: 6
Messages: 15

Thank you very much for your help!
The following one of your suggestions did it :). I successfully installed vim.
Code:
sudo pkg update -f

Hey Bernd,
Thanks for your contribution. I executed this and the one before you and it seems to have solved the size mismatch issue which occured for seemingly all packages to me.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,783
Messages: 34,911

Yeah, sometimes your locally cached repository database can get out of sync with the actual repository data. A pkg update or pkg update -f usually solves it.
 

balanga

Son of Beastie

Reaction score: 166
Messages: 3,377

I got the 'size mismatch' error just now when trying pkg install apache24

pkg update -f fixed it!
 

NuLL3rr0r

Active Member

Reaction score: 20
Messages: 221

Thank you so much [USER=1677]SirDice[/USER]. Faced the same issue on a new 12.0 install. Even in 2019 pkg update -f does wonders.
 

scottro

Daemon

Reaction score: 624
Messages: 1,660

Forget when I ran into this, but I also came across this thread and [USER=1677]SirDice[/USER]'s solution was the answer. (FreeBSD-12.0)
 

teekwan

New Member


Messages: 11

Thank you all!
Not to beat a dead horse (this thread I mean :) ) but pkg update -f solved my issue trying to install atop on my 11.2 :)
So it continues to do wonders in 2020 too :D
 

golpemortal

Member

Reaction score: 10
Messages: 66

pkg update -f # It always been good to me which makes everything great again. The best of FreeBSD is yet to come - Drive on Pathfinder
 
Top