I've recently made a bash script that can be downloaded and installed by users via a Makefile. The problem is that I'm not sure how to have dependencies get installed. In this case, the only dependency is jq. One method I thought might work would be to just run sudo apt-get install jq in the bash script itself when it detects that jq isn't installed, but this wouldn't work on all distros, since not all of them use apt as their package managers. What would be the ideal way to install a dependency in this case?


you can either make one script for each distribution you support or if you want to propose only one script for all, you will need to detect the OS version in your script to choose then if you want to run apt, yum or other

| improve this answer | |
  • I suppose this could be a solution, thanks – APixel Visuals May 10 '19 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.