Fix traceback in solaris package installation

Fixes #12237.