pkg(1) continues after pre-install script fails

Tijl Coosemans tijl at FreeBSD.org
Wed Aug 3 15:04:17 UTC 2016


The linux_base-* packages require Linux support in the kernel during
installation because they run /compat/linux/sbin/ldconfig.  The packages
have a PRE-INSTALL script that checks this and returns an error if the
support isn't there, but pkg(1) ignores such errors and continues to
install the files anyway.  Then it runs ldconfig via POST-INSTALL which
fails but errors from this are also ignored and pkg(1) exits normally.
It looks like this:

sysctl: unknown oid 'compat.linux.osrelease'
linuxulator is not (kld)loaded, exiting
pkg-static: PRE-INSTALL script failed
ELF binary type "0" not known.
/bin/sh: /compat/linux/sbin/ldconfig: Exec format error
pkg-static: POST-INSTALL script failed

Shouldn't pkg(1) abort when pre-install fails and return an error when
post-install fails?


More information about the freebsd-ports mailing list