Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 2
    Let me explain it. There is no need in rpm -aq and grep if you can do only rpm -q PACKAGE_NAME. So rpm will do grep for you. Commented May 2, 2013 at 10:32
  • 2
    This is the more elegant answer than the accepted one. The return value from rpm -q is all you need. Funnily, -qa doesn't return the same return codes, so you need to redirect stdout to /dev/null and stick with -q. Commented Nov 17, 2014 at 19:07