refine procedure of installing pkgs