I want to check whether a program like firefox exists on ubuntu or not. In case it is not installed, I want to install it. I studied this topic and got information about command -v p programName
, but I didn't understand how can I check if the program is installed or not. I want to write this:
#If firefox not installed:
sudo apt-get update
sudo apt install firefox
but I don't know how to write the if condition part.