Defined a utility function: ispkginstalled