Enhance installation reliability and reorder package dependencies