Fixed package checking on Ubuntu and port-occupied issues