I recently upgraded the linux_base-c7 package and saw the following error message in the pkg output:
[1/22] Extracting linux_base-c7-7.8.2003_1: 100%
ELF binary type "0" not known.
/bin/sh: /compat/linux/usr/bin/gio-querymodules-32: Exec format error
I am running FreeBSD 13.0-CURRENT r360869
Check with kldstat if both linux64.ko and linux.ko have been loaded. I suspect you only have 64 bit linux support enabled but not 32 bit. The easiest way to enable linux support is to add linux_enable="YES" to /etc/rc.conf.
(In reply to Tijl Coosemans from comment #1)
I think that you've nailed it.
So when I was upgrading linux_base-c7 I got a message that Linux kernel modules are not loaded. So I loaded "linux64" and ran pkg upgrade again. Then I got the messages I posted in the description. I didn't load the "linux" module and that's probably the issue.
I am not sure if there is anything to fix apart from maybe improving checks/error messages.