HowTo Update misc/compat5x
Describes how to fix issues with removal of compat5x package.
Description
This happens because the files have the flag schg on them.
schg = system immutabnle flag
This must be removed for a successful removal or re-installation of the compat5x package.
This fix will not work if you have the kernel in security mode 1 or above.
If your system uses kernel security mode 1 or above you need to boot the system into single-user mode and follow the instructions below. I would probably do the actual upgrade in single-user mode as well just to be on the safe side.
The Fix
For some reason the update process of compat5x sometimes fails with a message that the files /usr/local/lib/compat/libc.so.5 and various others cannot be removed. To fix this run
chflags noschg /usr/local/lib/compat/pkg/libc.so.5
chflags noschg /usr/local/lib/compat/pkg/libc_r.so.5
chflags noschg /usr/local/lib/compat/pkg/libcrypt.so.2
chflags noschg /usr/local/lib/compat/pkg/libpthread.so.1
chflags noschg /usr/local/lib/compat/pkg/libthr.so.1
Check
ls -lo /usr/local/lib/compat/pkg/libc.so.5
ls -lo /usr/local/lib/compat/pkg/libc_r.so.5
ls -lo /usr/local/lib/compat/pkg/libcrypt.so.2
ls -lo /usr/local/lib/compat/pkg/libpthread.so.1
ls -lo /usr/local/lib/compat/pkg/libthr.so.1
If Installation still fails try this
chflags noschg /usr/local/lib/compat/pkg/libc.so.5
chflags noschg /usr/local/lib/compat/pkg/libc_r.so.5
chflags noschg /usr/local/lib/compat/pkg/libcrypt.so.2
chflags noschg /usr/local/lib/compat/pkg/libpthread.so.1
chflags noschg /usr/local/lib/compat/pkg/libthr.so.1
chflags noschg /usr/local/lib/compat/libc.so.5
chflags noschg /usr/local/lib/compat/libc_r.so.5
chflags noschg /usr/local/lib/compat/libcrypt.so.2
chflags noschg /usr/local/lib/compat/libpthread.so.1
chflags noschg /usr/local/lib/compat/libthr.so.1
Check
ls -lo /usr/local/lib/compat/pkg/libc.so.5
ls -lo /usr/local/lib/compat/pkg/libc_r.so.5
ls -lo /usr/local/lib/compat/pkg/libcrypt.so.2
ls -lo /usr/local/lib/compat/pkg/libpthread.so.1
ls -lo /usr/local/lib/compat/pkg/libthr.so.1
ls -lo /usr/local/lib/compat/libc.so.5
ls -lo /usr/local/lib/compat/libc_r.so.5
ls -lo /usr/local/lib/compat/libcrypt.so.2
ls -lo /usr/local/lib/compat/libpthread.so.1
ls -lo /usr/local/lib/compat/libthr.so.1