installpkg.sh: more checks for errors