# An happy fix for the PKG Mismatch of FreeBSD 12.0 Current/Stable



## Spartrekus (Jan 4, 2019)

Hello,

After installation of FreeBSD vers.12.0 (i386), there is an error of pkg mismatch.
If you enter 'y', then, the installation is broken, stating issue with PKG, and it is a dead end. After pressing 'y', pkg will not continue. It will missing libraries.

There was a missing file libssl and libcrypto error. 

A possible workaround is to use "fetch" and populate the missing libraries into /usr/lib/

Here are the files for others that cannot install FreeBSD 12.0.


```
cd /usr/lib
fetch https://raw.githubusercontent.com/spartrekus/freebsd-13-entropyfix/master/libssl.so.111
fetch  https://raw.githubusercontent.com/spartrekus/freebsd-13-entropyfix/master/libcrypto.so.111
```

Once those files in /usr/lib, then you can try to install the 12.0 FreeBSD release. It works at least for gcc.

Good Luck!


----------



## aragats (Jan 4, 2019)

Spartrekus said:


> After installation of FreeBSD vers.12.0 (i386), there is an error of pkg mismatch.


Do you mean *clean* installation or an upgrade???
If the former its sounds really weird.
If it's the latter, you're supposed to run `pkg-static install -f pkg` as pkg output suggests.


----------



## Spartrekus (Jan 4, 2019)

Yeah a completely clean, *very clean* installation. 
I took r328126/x86 i386 because of the entropy bug. Once done, then, pkg failed. I had to find a work around, you know. Anyhow the only passing entropy is the r328126, no other single 11.2, 12.0 current, 13.0 passes it on my notebook (too brand new). 

pkg-static, I will give a try.


----------



## Spartrekus (Jan 4, 2019)

nope not helping...

pkg: cached package chromium 68-0.3440 106_7 size mismatch, cannot continue


----------



## shkhln (Jan 4, 2019)

Spartrekus said:


> I took r328126/x86 i386 because of the entropy bug.



Wtf is "entropy bug"?


----------



## twllnbrck (Jan 4, 2019)

Is pkg already installed or some other 3rd party SW?

You can try a force update of the repository catalog and clean your pkg cache

```
# pkg clean
# pkg update -f
```


----------



## scottro (Jan 4, 2019)

To answer shkhln the I'm guessing that this refers to the bug that many people have had, after installation, it fails to boot with a message about entropy.


----------



## Beastie (Jan 4, 2019)

shkhln said:


> Wtf is "entropy bug"?


Thread freebsd-12-cant-find-boot-entropy.68265
Thread upgrade-11-2-to-12-0-boot-entropy-fail.68708
Thread install-from-usb-stick-cant-find-boot-entropy.68858


----------



## shkhln (Jan 4, 2019)

Oh, you mean missing entropy cache? It is not a bug. Most likely whatever step of the boot process that comes after this line failed before it had a chance to print a message.


----------



## Spartrekus (Jan 4, 2019)

Lanakus said:


> Is pkg already installed or some other 3rd party SW?
> 
> You can try a force update of the repository catalog and clean your pkg cache
> 
> ...



I tried pkg clean, ok, but after mismatch again.
pkg clean
pkg update -f
fetching ... meta... packages,
... running kernel
*Allow missmatch now? [Y/n] <<-- this is then broken*

Yes, just installed 12.0 Freebsd, and as root
# pkg
it updates, and it goes to mismatch directly   Quite sad.


----------



## twllnbrck (Jan 4, 2019)

Spartrekus said:


> Yes, just installed 12.0 Freebsd, and as root
> # pkg
> it updates, and it goes to mismatch directly  Quite sad.


So pkg itself wont be installed?

Try to reinstall pkg from remote repository

```
pkg bootstrap -f
```


----------



## tedbell (Jan 5, 2019)

I am still getting the error too even after a 
	
	



```
pkg update -f
```


----------



## twllnbrck (Jan 5, 2019)

You could also use the Latest package branch for your repository and try again.


----------



## Spartrekus (Jan 5, 2019)

Tested and here more information... 

Reinstalled a new notebook, and it shows up as follows (very clean, fresh, installation).

pkg bootstrap -f 
gives shared object "libssl.so.111" not found, required by "pkg"

pkg update -f 
gives shared object "libssl.so.111" not found, required by "pkg"

It looks kinda dead end to me.... let hope you have any further ideas for a possible fix.


----------



## tedbell (Jan 5, 2019)

Changing to the "latest" repo fixed it but I lost qutebrowser in the process.


----------



## twllnbrck (Jan 5, 2019)

tedbell said:


> Changing to the "latest" repo fixed it but I lost qutebrowser in the process.


 Did you do a `# pkg update -f` after switching to the latest branch?


----------



## tedbell (Jan 5, 2019)

Lanakus said:


> Did you do a `# pkg update -f` after switching to the latest branch?



yup
looks like they're dropping qutebrowser for version 13 as it's not in the latest repo. I downloaded the source and it runs however so all is well.


----------



## twllnbrck (Jan 5, 2019)

tedbell said:


> looks like they're dropping qutebrowser for version 13 as it's not in the latest repo.


Ah, do you use 13-CURRENT? Maybe qutebrowser has not yet get ported?
Anyway, nice to here that your problems are solved


----------



## tedbell (Jan 5, 2019)

Lanakus said:


> Ah, do you use 13-CURRENT? Maybe qutebrowser has not yet get ported?
> Anyway, nice to here that your problems are solved



Nah, I'm on 12 RELEASE p1. I am using the latest repo to fix this pkg issue. Qutebrowser is available in the 12.0 release repo.


----------



## bart (Jan 5, 2019)

Spartrekus said:


> Tested and here more information...
> 
> Reinstalled a new notebook, and it shows up as follows (very clean, fresh, installation).
> 
> ...



use pkg-static()


----------



## twllnbrck (Jan 5, 2019)

Spartrekus said:


> It looks kinda dead end to me.... let hope you have any further ideas for a possible fix.


Mmh. Sounds really weird. My understanding looks like this:

After a fresh install you can use `pkg bootstrap` to install the pkg system with man pages on its own without adding other software. But I think that is mostly used for setup scripts.

FreeBSD ships by default with the very small package manager pkg(7) which is barely able to install the current pkg(8) manager and surrenders all responsibilty for package management to it. So running `# /usr/sbin/pkg` or `# pkg install foo` the first time the installation starts by downloading the pkg tools from a mirror. Pkg then installs the available catalog. Thats the way I use mostly.

pkg-static(8) is a static link of pkg and normally only used to install or to upgrade pkg(8) itself if it is broken by a major system upgrade. Most libraries are included in the binary. So pkg-static don't depend on libssl.so and is therefore always functional. So bart might be right that you will succeed with `pkg-static install pkg` or if pkg was already installed with `pkg upgrade -f pkg`. But Im not sure if its part of the base system after install.

So much typing of the string 'pkg' can be a little bit confusing


----------



## twllnbrck (Jan 6, 2019)

Another option is to install the port ports-mgmt/pkg.


----------



## Spartrekus (Jan 6, 2019)

I am confused about pkg and its function.  I will read more about it.


Maybe the base system can be uncompressed to avoid pkg to be used.

I don't know.

HAL might help there.


----------



## twllnbrck (Jan 6, 2019)

Spartrekus said:


> I am confused about pkg and its function. I will read more about it.



I can still understand but its maybe justified by my bad explanation skills .
pkg(7) and pkg(8) are two different things. Maybe this statement from the pkg(7) manpage can shed some light on

```
pkg is the package management tool.  It is used to manage local packages
installed from ports(7) and install/upgrade packages from remote reposi-
tories.

To avoid backwards incompatibility issues, the actual pkg(8) tool is not
installed in the base system.  The first time invoked, pkg(7) will bootstrap
the real pkg(8) from a remote repository.
```

pkg(8) is so speak able to install itself via pkg(7).


----------



## Spartrekus (Jan 6, 2019)

Thank you !

Pkg can anytime be a confusing thing, indeed. PKG is complex (database,...). 

Besides, BSD/Unix have become a complex system, which is not so easy to fully understand. About 45 years ago, the core system was much smaller, easier to understand the functionalities.
https://github.com/spartrekus/Unix-V5


----------



## twllnbrck (Jan 6, 2019)

Spartrekus said:


> Besides, BSD/Unix have become a complex system, which is not so easy to fully understand. About 45 years ago, the core system was much smaller, easier to understand the functionalities.


 
But thankfully, FreeBSD is one of or the best documented OS.


----------

