Fix pkg install

pkg_deps() is not safe to use if we are about remove remove content.
use HASH_ITER instead