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: tudor@pandora / $ 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 tudor@pandora / $ 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>
tudor@pandora / $ dpkg -L libapache2-mod-php5
/.
/usr
/usr/share
/usr/share/doc
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libapache2-mod-php5
/usr/lib
/usr/lib/apache2
/usr/lib/apache2/modules
/usr/lib/apache2/modules/libphp5.so
/usr/lib/php5
/usr/lib/php5/20090626+lfs
/etc
/etc/apache2
/etc/apache2/mods-available
/etc/apache2/mods-available/php5.conf
/etc/apache2/mods-available/php5.load
/etc/php5
/etc/php5/apache2
/usr/share/doc/libapache2-mod-php5
/etc/php5/apache2/conf.d
tudor@pandora / $
Credits go to this HowToGeek article.
Write Comment |
||||
Last Updated ( Saturday, 08 September 2012 ) |
Joomla stuff
Newsletter
Auto tags
None yet