Pkg fixes

trying to join all efforts for solving the pkg issues.

still working on a docker based test
its rebased. github was confused