Check dependency and install application from internet in red-hat,ubuntu,cent-os .
I want to write script, In which i have to check dependency of application and download it from internet at the time of installation or by another way to check the dependency online.
for eg. mysql,mariadb,nano,netbeans etc.
Please suggest me how can I do that.