# I can't upgrade pkg after upgrading 11.2 to 12.0



## pavlar (Dec 14, 2018)

sudo pkg upgrade
Password:
ld-elf.so.1: Shared object "libssl.so.8" not found, required by "pkg"


----------



## pavlar (Dec 14, 2018)

i resolve the problem:
1..pkg-static del -f pkg
2. pkg upgrade
Now it works Thanks


----------



## SirDice (Dec 14, 2018)

pavlar said:


> i resolve the problem:
> 1..pkg-static del -f pkg
> 2. pkg upgrade


This is the correct way after a major version upgrade:

```
pkg-static install -f pkg
pkg upgrade -f
```


----------



## pavlar (Dec 14, 2018)

SirDice said:


> This is the correct way after a major version upgrade:
> 
> ```
> pkg-static install -f pkg
> ...


I noticed that "pkg upgrade" after "pkg-static del -f pkg"  does it automatically


----------



## SirDice (Dec 14, 2018)

No, it does not. It will only update packages that happen to be out of date. After a major version upgrade you must reinstall _all_ packages, which is what `pkg upgrade -f` does.


----------



## pavlar (Dec 14, 2018)

*I did it without these recommendations:*
$sudo pkg-static del -f pkg
Password:
pkg-static: Warning: Major OS version upgrade detected.  Running "pkg-static install -f pkg" recommended
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
    pkg-1.10.5_5

Number of packages to be removed: 1

The operation will free 12 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling pkg-1.10.5_5...
[1/1] Deleting files for pkg-1.10.5_5: 100%
nat:[~]$sudo pkg upgrade
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.10.5_5...
Extracting pkg-1.10.5_5: 100%
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB   2.2MB/s    00:03
Processing entries: 100%
FreeBSD repository update completed. 31468 packages processed.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (119 candidates): 100%
Processing candidates (119 candidates): 100%
The following 118 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
    ca_root_nss: 3.40 -> 3.41

Installed packages to be REINSTALLED:
    unixODBC-2.3.7 (ABI changed: 'freebsd:11:x86:64' -> 'freebsd:12:x86:64')
    unbound-1.8.0 (ABI changed: 'freebsd:11:x86:64' -> 'freebsd:12:x86:64')
    tshark-2.6.3 (ABI changed: 'freebsd:11:
etc etc


----------



## Robbin Johnson (Dec 17, 2018)

I just installed 12.0-STABLE on a Raspberry PI 3B and I get the same error.  Running "pkg-static del -f pkg" followed by "pkg upgrade" (with and without the -f) does not resolve this issue: I still get the shared object not found error.

Does anyone have any recommendations?


----------



## goshanecr (Dec 17, 2018)

How you install 12-STABLE? Upgrade from 11.x? If yes, in which way `make buildworld .....` or `freebsd-upgrade ...`?
And what shows error if you say that you already do `pkg upgrade -f`?

Give all information!


----------



## Robbin Johnson (Dec 17, 2018)

The 12-STABLE install was directly from a  .img file downloaded from freebsd.org and installed on a 16GB microSD card using "dd" on an iMac:

% sudo dd bs=1m if=FreeBSD-12.0-STABLE-arm64-aarch64-RPI3-20181213-r341991.img of=/dev/rdisk11
2560+0 records in
2560+0 records out
2684354560 bytes transferred in 193.926793 secs (13842103 bytes/sec)

Very soon after the install I attempted to install an additional port (I do not recall which) and ran into the above shared object issue.  I have repeated the pkg-static del -f pkg followed by pkg upgrade actions several times, adding reboots between the steps and other variations (like running pkg upgrade with and without -f).

pkg-static del -f pkg appears to run with no errors.

The output from the pkg upgrade -f:

root@generic:~ # pkg upgrade -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:aarch64/latest, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.10.5_3...
Extracting pkg-1.10.5_3: 100%
ld-elf.so.1: Shared object "libssl.so.8" not found, required by "pkg"


----------



## SirDice (Dec 18, 2018)

goshanecr said:


> How you install 12-STABLE? Upgrade from 11.x? If yes, in which way  make buildworld ..... or  freebsd-upgrade ...?


You can't update/upgrade a -STABLE version with freebsd-update(8).


----------



## trev (Dec 20, 2018)

Robbin Johnson said:


> root@generic:~ # pkg upgrade -f
> The package management tool is not yet installed on your system.
> Do you want to fetch and install it now? [y/N]: y
> Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:aarch64/latest, please wait...
> ...



I just struck this issue upgrading from 12-CURRENT to 13-CURRENT on my rpi3.

The solution was to compile the ports version of pkg and install that. It then, of course, links against the correct openssl libraries and resolves pkg's missing libraries issue.


----------



## Robbin Johnson (Dec 20, 2018)

That did it!  Thank you.

(As soon as I read your post it did seem a bit obvious that this is the solution.  Doh!)


----------



## panjie (Mar 8, 2019)

pavlar said:


> i resolve the problem:
> 1..pkg-static del -f pkg
> 2. pkg upgrade
> Now it works Thanks


It works, Thank you!


----------



## laufdi (Mar 8, 2019)

So on a raspberry pi I have to install the ports tree and compile from source? Really?
(I flashed the 12-STABLE image on RPI-B: FreeBSD-12.0-STABLE-arm-armv6-RPI-B-20190307-r344851.img)


----------



## SirDice (Mar 8, 2019)

laufdi said:


> So on a raspberry pi I have to install the ports tree and compile from source? Really?


You misunderstood. Read the thread again.


----------



## laufdi (Mar 8, 2019)

trev said:


> The solution was to compile the ports version of pkg and install that.





Robbin Johnson said:


> That did it! Thank you.


What did I misunderstand?

[FONT=courier new][1/1] Deinstalling pkg-1.10.5_3...
[1/1] Deleting files for pkg-1.10.5_3: 100%
root@rpi-b:/home/freebsd # pkg upgrade
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:armv6/latest, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.10.5_3...
Extracting pkg-1.10.5_3: 100%
ld-elf.so.1: Shared object "libssl.so.8" not found, required by "pkg"[/FONT]


----------



## laufdi (Mar 8, 2019)

The solution (workaround) I found here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233225#c4

[FONT=courier new]# pkg-static install openssl
# ln -s /usr/local/lib/libssl.so.9 /usr/lib/libssl.so.8
# ln -s /usr/local/lib/libcrypto.so.9 /usr/lib/libcrypto.so.8[/FONT]

now pkg works ...


----------



## trev (Mar 9, 2019)

> > The solution was to compile the ports version of pkg and install that.





laufdi said:


> What did I misunderstand?
> 
> [FONT=courier new][1/1] Deinstalling pkg-1.10.5_3...
> [1/1] Deleting files for pkg-1.10.5_3: 100%
> root@rpi-b:/home/freebsd # pkg upgrade[/FONT]



What you missed was the you did not compile the ports version; you tried installing the pkg version


----------



## laufdi (Mar 9, 2019)

I still don't understand. "compile the ports version" means

[FONT=courier new]# cd /usr/ports/ports-mgmt/pkg/ && make install[/FONT]

right?


----------



## trev (Mar 9, 2019)

laufdi said:


> I still don't understand. "compile the ports version" means
> [FONT=courier new]# cd /usr/ports/ports-mgmt/pkg/ && make install[/FONT]



Correct.


----------



## laufdi (Mar 9, 2019)

And that implies:


laufdi said:


> So on a raspberry pi I have to install the ports tree and compile from source? Really?


or not? Where is my misunderstanding then?


----------



## SirDice (Mar 11, 2019)

Post #3:

```
pkg-static install -f pkg
pkg upgrade
```


----------



## laufdi (Mar 11, 2019)

SirDice said:


> Post #3:
> 
> ```
> pkg-static install -f pkg
> ...


I still get the error like this.


```
# ldd /usr/local/sbin/pkg
/usr/local/sbin/pkg:
...
    libssl.so.8 => not found (0)
    libcrypto.so.8 => not found (0)
...
    libssl.so.8 => not found (0)
    libcrypto.so.8 => not found (0)
...
```


----------

