11 February 2008

Request DEB packages ("Debian-like" GNU/Linux distribution)

A simple refresh of what can be done with dpkg tool.

All those commands query installed packages.

Get the list of packages:
dpkg -l

Get the list of packages matching a specific pattern:
dpkg -l pattern
For instance for libraries: dpkg -l lib*

General information about a package:
dpkg -s myPackageName[-myCompletePackageVersion]

Get the list of files of a package:
dpkg -L myPackageName

Get the package providing a specific file:
dpkg -S myFilePathOrPattern*
*: absolute path or pattern

To get the general information of the package providing a specific file (under GNU/Bash) with only one command line:
dpkg -s $( dpkg -S myFilePath |awk '{print $1}' |sed -e 's/://g;' )

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: