Shared object “” not found

If you see the following error after pkg upgrade or pkg install Shared object “” not found

Your FreeBSD version might be outdated. This currently happens on FreeBSD 11.1 if you use the latest/qarterly pkg mirror.

How to fix it?

freebsd-update -upgrade -r 11.2-RELEASE 
freebsd-update install 
pkg update && pkg upgrade