Use "dpkg-query" to detect whether a package is installed