Trying to install required packages if not installed

The script tries to install the required packages if they are not installed instead of exiting the script.