debian goodness
How to check for installed packages in Debian or Ubuntu?
The command we need to use is dpkg –get-selections, which provides a list of all the currently installed packages.
$ dpkg --get-selections
It is easy to filter through grep to get results for the exact package you need. For instance, if you want to see which php packages are already installed through apt-get:
$ dpkg --get-selections | grep php
libapache2-mod-php5 install
php-db install
php-pear install
php-sqlite3 install
php5 install
php5-cli install
php5-common install
php5-gd install
php5-memcache install
php5-mysql install
php5-sqlite install
php5-sqlite3 install
php5-xsl install
You can find the locations of the files within a package from the list by using the dpkg -L command, such as:
$ dpkg -L php5-gd
/.
/usr
/usr/lib
/usr/lib/php5
/usr/lib/php5/20060613
/usr/lib/php5/20060613/gd.so
/usr/share
/usr/share/doc
/etc
/etc/php5
/etc/php5/conf.d
/etc/php5/conf.d/gd.ini
/usr/share/doc/php5-gd
Now I can take a look at the gd.ini file and change some settings around…