# Upgrade to 12.2-p4 Causing pkg Kernel Version and Undefined Symbol Errors



## BawdyAnarchist (Mar 4, 2021)

I upgraded the host from 12.2-p1 to 12.2-p4 ; and then upgraded my gui-jail template as well. This caused many of my gui applications to stop working, throwing the following error for Firefox, Libreoffice, and Telegram-Desktop:

```
ld-elf.so.1: /usr/local/lib/libglib-2.0.so.0: Undefined symbol "pthread_setname_np@FBSD_1.6"
```
I even tried to fresh install a new gui-jail template: (_0kde_ is the name of this gui-jail attempted install)

```
zfs create zroot/jails/0kde
bsdinstall jail /jails/0kde
jail -c 0kde
freebsd-update -b /jails/0kde fetch install
```
Checking from inside the jail shows: `freebsd-version -u` 12.2-RELEASE-p4 ... and uname from host reveals the same.
When I go inside the freshly installed jail and try to install pkg, I get the following error:

```
root@0kde:~ # pkg install
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
[0kde] Installing pkg-1.16.3...
Newer FreeBSD version for package pkg:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1202000
- running kernel: 1201000
Ignore the mismatch and continue? [y/N]:
```
So it seems somehow my jail isn't actually the proper kernel version? I have to think this is related to the Undefined symbol, but maybe not. What really makes no sense to me, is that I'm extracting base.txz straight from FreeBSD servers, and inside the jail apparently shows the correct 12.2-p4 version when queried, but pkg doesn't think so.

Can anyone offer some help and/or troubleshooting ideas?


----------



## SirDice (Mar 4, 2021)

BawdyAnarchist said:


> ```
> - package: 1202000
> - running kernel: 1201000
> ```


This seems to indicate that the kernel is still 12.1. Jails don't have a kernel, so this would be the host's kernel. Compare `uname -a` and `freebsd-version -k` on the host. I've seen some people doing the update but never rebooted, so the new kernel wasn't active. Also check /usr/local/etc/pkg.conf, I've also seen some instances where the kernel version was set in pkg.conf.


----------



## BawdyAnarchist (Mar 5, 2021)

SirDice said:


> This seems to indicate that the kernel is still 12.1. Jails don't have a kernel, so this would be the host's kernel. Compare `uname -a` and `freebsd-version -k` on the host. I've seen some people doing the update but never rebooted, so the new kernel wasn't active. Also check /usr/local/etc/pkg.conf, I've also seen some instances where the kernel version was set in pkg.conf.


Both commands show the same: 12.2-RELEASE-p4
Checked pkg.conf from both host/jail; doesn't seem to show anything in uncommented lines related to kernel, or the 1201000/1202000 numbers, or freebsd version
I have rebooted host a few times, just to be sure
I also did `uname -K`, and it's showing the latest version, 1202000
`pkg upgrade` has been run on host

Any other ideas to check?


----------



## SirDice (Mar 5, 2021)

I've been looking at the pkg(8) sources to see how it determines the system's version, as far as I've been able to find out it uses uname(3). You can "trick" it by setting various environment variables. This is a thread with the same issue: https://forums.freebsd.org/threads/...the-same-but-differ-from-pkg-osversion.79168/

In both cases the OS and the jail appear to be updated (all the tools indicate that) yet pkg(8) still complains about the mismatch. I can't really put my finger on it where it's going wrong.


----------



## BawdyAnarchist (Mar 5, 2021)

Well I guess I'm not the only one having this problem. Really, I wouldn't care except for the undefined symbol error preventing me from running gui programs. 

I'm almost at the point that I'm just going to install 13.0 rc1 when it drops in a few days and hope for the best. Or I guess I could revert back to p1, but that seems like going the wrong direction.


----------



## pez (Mar 12, 2021)

I'm having a similar problem I'm on 12.1-RELEASE-p11 and when i try to use nslookup

andrew@skynet:/home/andrew % nslookup www.yahoo.com localhost
ld-elf.so.1: /usr/local/bin/nslookup: Undefined symbol "pthread_setname_np@FBSD_1.6"

and named isn't running anyway, but i get the same using google's dns server

did you have any joy with 13.0?


----------



## SirDice (Mar 12, 2021)

pez said:


> I'm having a similar problem I'm on 12.1-RELEASE-p11


FreeBSD 12.1 is end-of-life and not supported any more. Upgrade to 12.2.


----------



## pez (Mar 12, 2021)

yeah working on it, however the author was on 12.2 p4.

anyway, that got rid of that error, and bind is still non functional. trying
sudo pkg-static upgrade -f


----------



## SirDice (Mar 12, 2021)

pez said:


> yeah working on it, however the author was on 12.2 p4.


As far as I've been able to find out the issue of the OP is caused by building from source and having NO_CLEAN enabled. Different issue.


----------



## pez (Mar 12, 2021)

ah ok no worries. i just ddg'd my error message and ended up here.


----------

