{"id":4506,"date":"2018-06-21T17:49:01","date_gmt":"2018-06-21T17:49:01","guid":{"rendered":"https:\/\/geekdecoder.com\/?p=4506"},"modified":"2018-06-21T17:49:01","modified_gmt":"2018-06-21T17:49:01","slug":"check-if-a-package-is-installed","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2018\/06\/21\/check-if-a-package-is-installed\/","title":{"rendered":"Check if a Package is Installed"},"content":{"rendered":"<p>One of the most common requests and inquirys is &#8220;Do I have the &#8230;xyz package or program installed?&#8221; Here is how to check.<\/p>\n<p>Ubuntu\/Debian<\/p>\n<p>List all packages<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# dpkg -l | less\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# dpkg -s apache-perl\n\n<\/pre>\n<p>To check whether a package is installed or not:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\ndpkg -l | grep vlc\n\n<\/pre>\n<p>Use file \/var\/lib\/dpkg\/available to find out all package names available to you. Or use following command (list all packages in \/var\/lib\/dpkg\/status):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# dpkg-query -l\n\n<\/pre>\n<p>You can also try to match package name using wild cards:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# dpkg-query -l &#039;libc6*&#039;\n<\/pre>\n<p>Use the following command to get exact status (whether it is installed or not):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# dpkg-query -W -f=&#039;${Status} ${Version}\\n&#039; apache-perl\n\n<\/pre>\n<p>CentOS and RPM based Distros<\/p>\n<p>Under Red Hat\/Fedora\/CentOS\/Suse Linux use the rpm command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# rpm -qa | grep {package-name}\n\n<\/pre>\n<p>For example find out package mutt installed or not:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# rpm -qa | grep mutt\n\n<\/pre>\n<p>On a CentOS\/RHEL use the following yum command to tell whether a package named htop is installed:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# yum list installed {PACKAGE_NAME_HERE}\n\n<\/pre>\n<p>[\/bash]<\/p>\n<p># yum list installed htop<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the most common requests and inquirys is &#8220;Do I have the &#8230;xyz package or program installed?&#8221; Here is how to check. Ubuntu\/Debian List all packages # dpkg -l | less # dpkg -s apache-perl To check whether a package is installed or not: dpkg -l | grep vlc Use file \/var\/lib\/dpkg\/available to find &#8230; <a title=\"Check if a Package is Installed\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2018\/06\/21\/check-if-a-package-is-installed\/\" aria-label=\"Read more about Check if a Package is Installed\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-4506","post","type-post","status-publish","format-standard","hentry","category-administration"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=4506"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4506\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=4506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=4506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=4506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}