some changes applied to debian postinst