How to check if a package is installed on Ubuntu

Run the following command to get the list of all the services which are running or are in active state

apt -qq list <packagename>


apt -qq list zip 

where zip is the package name in the above command.

The output should look like this:

  zip/focal,now 3.0-11build1 amd64 [installed]