Modified code for installing required packages based on distro and it's version