Fix the packages calculation on ubuntu