Skip to content
Advertisement

Checking for installed packages and if not found install

I need to check for installed packages and if not installed install them.

Example for RHEL, CentOS, Fedora:

JavaScript

How do I do a check in BASH?

Do I do something like?

JavaScript

And what do I need to use for other distributions? apt-get?

Advertisement

Answer

Try the following code :

JavaScript

or shorter :

JavaScript

For debian likes :

JavaScript

For archlinux :

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement