Debian/Ubuntu: Using dpkg to find installed package by string and list its files

Saturday, 08 September 2012

This is a note to self, and I'm sure it will also benefit whoever always forgets what the right tool is: apt-get, aptitude, apt-cache or dpkg.

1. Listing packages from the command line

dpkg --get-selections |grep <your-search-string>

 For example, if you need to know what PHP5 related packages are installed the corresponding command is:

[email protected] / $ dpkg --get-selections | grep php5
libapache2-mod-php5        install
php5            install
php5-cli          install
php5-common          install
php5-curl          install
php5-gd            install
php5-memcached          install
php5-mysql          install
php5-sqlite          install
php5-xcache          install
[email protected] / $

2. Listing files for a given package  from the command line:

This provides a quick way to locate the ini files or data/cache directories for a given package

dpkg -L <package-name>


 [email protected] / $ dpkg -L libapache2-mod-php5
[email protected] / $ 

Credits go to this HowToGeek article.

Give us some social love (it really works now)!

Reddit!! StumbleUpon! Yahoo! Swik!

Be first to comment this article
RSS comments

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Please don't use comments to plug your web site. Links are rel='nofollow'-ed
  • Please refresh the page if you're having trouble with the security image code

:) :grin ;) 8) :p
:roll :eek :upset :zzz :sigh
:? :cry :( :x
Code:* Code

Last Updated ( Saturday, 08 September 2012 )
Post and Bid on Joomla/PHP projects! Join for free!

Europe freelancer directory


Subscribe to TeachMeJoomla's newsletter

Auto tags

None yet