Desired=Unknown/Install/Remove/Purge/Hold Status=Not/Installed/Config-files/Unpacked/Failed-config/. / Err?=(none)/Hold/Reinst-required/X=both-problems / Name Version Description +++-===============-==============-======== ii gcc 4.0.1-3 The GNU C compiler ii gcc-3.3-base 3.3.6-8ubuntu1 The GNU Compiler Colletio un gcc-3.5 none (no description available) un gcc-3.5-base none (no description available) un gcc-3.5-doc none (no description available) ii gcc-4.0 4.0.1-4ubuntu9 The GNU C compiler ...
In the above listing, the first 'i' denotes desired state which is install. The second 'i' denotes the actual state ie gcc is installed. The third column gives the error problems if any. The fourth, fifth and sixth column gives the name, version and description of the packages respectively. And gcc-3.5 is not installed on my machine. So the status is given as 'un' which is unknown not-installed.
-s 檢查是否裝過
dpkg -s gedit
Two days back, I installed beagle (a real time search tool based on Mono) on my machine. But I didn't have a clue about the location of the files as well as what files were installed along with beagle. That was when I used the -L option to get a list of all the files installed by the beagle package.
# dpkg -L beagle
Even better, you can combine the above command with grep to get a listing of all the html documentation of beagle.
# dpkg -L beagle | grep html$
These are just a small sample of the options you can use with dpkg utility. To know more about this tool, check its man page. If you are alergic to excessive command line activities, then you may also use dselect which is a curses based menu driven front-end to the low level dpkg utility.