Some Debian/Ubuntu tricks

Some tricks in Linux I find useful

One thing I’ve faced recently was getting the list of packages installed in Ubuntu.

So to get a list of installed Debian/Ubuntu packages do

zalex:~# dpkg --get-selections
adduser                                         install
apache                                          deinstall
apache-common                                   install
apache2-mpm-prefork                             install
...long list here...

To find out which package a file belongs to, do

zalex:~# dpkg -S /etc/php5/conf.d/pdo.ini
php5-common: /etc/php5/conf.d/pdo.ini

that works even for directories:

zalex:~# dpkg -S /etc/php5/conf.d
php5-gd, php5-sqlite, php5-common, php5-mysql: /etc/php5/conf.d

The same actually works for Debian, for example I still have a Debian VM.

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *