Quantcast
Channel: Script to check if some program is already installed - Ask Ubuntu
Viewing all articles
Browse latest Browse all 6

Answer by user535733 for Script to check if some program is already installed

$
0
0

One easy way to check for installed packages using apt-mark:

apt-mark showinstall will list all packages marked install (already installed, or queued for installation). After that, it's a simple matter of grepping the package(s) you care about.

Example: apt-mark showinstall | grep -q "^$PACKAGE_NAME$" && echo "installed" || echo "not"


Viewing all articles
Browse latest Browse all 6

Trending Articles