{"id":215,"date":"2011-07-26T15:31:19","date_gmt":"2011-07-26T15:31:19","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=215"},"modified":"2013-05-18T09:11:45","modified_gmt":"2013-05-18T07:11:45","slug":"check-what-is-installed-on-debian-ubuntu","status":"publish","type":"post","link":"https:\/\/www.extradrm.com\/?p=215","title":{"rendered":"Check what is installed on Debian \/ Ubuntu version ?"},"content":{"rendered":"<p>For linux Version :<\/p>\n<pre>uname -a\r\n\r\n&gt;&gt; 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 i686 i386 GNU\/Linux<\/pre>\n<p>For the version Debian you can use :<\/p>\n<pre>cat \/etc\/debian_version<\/pre>\n<p>To check what have install by listing all using dpkg is easy.<\/p>\n<pre><code>dpkg -l<\/code><\/pre>\n<p>To check whether a package is install also easy.<\/p>\n<pre><code>dpkg -l | grep apache<\/code><\/pre>\n<p>The command above is some how redundant, because dpkg support wild characters, doing this instead<\/p>\n<pre>dpkg -l \"apache*\"<\/pre>\n<p>By doing this, it will also list the package that not install but available in dpkg cache, to install them you can simply <strong>apt-get<\/strong>. To indicate the packages installed it shows \u201cii\u201d and not install shows \u201cun\u201d.<\/p>\n<p>To know more, sometimes we wanna know what files is installed with the package. But with this query, you need to put the exact package name.<\/p>\n<pre>dpkg -L apache2<\/pre>\n<p>To list more simple result for script manipulation? You can check out dpkg-query, it support -l and -L and more options. For example, -W will list only the package name and the version for installed packages.<\/p>\n<pre>dpkg-query -W \"apache*\"<\/pre>\n<p>To be more specific, check out the dpkg manual at -f, you can specified what should only output. A simple example, where I just want the package name.<\/p>\n<pre><code>dpkg-query -W -f='${Package}n' \"apache*\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For linux Version : uname -a &gt;&gt; 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 i686 i386 GNU\/Linux For the version Debian you can use : cat \/etc\/debian_version To check what have install&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[34,14],"tags":[],"youtube_video":null,"_links":{"self":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/215"}],"collection":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215"}],"version-history":[{"count":0,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2843"}],"wp:attachment":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}