Install required packages and enforce ordering