Install packages if they are missing.