Added error check in the install_common_packages function.