deb
Package removal through dpkg is also straightforward and is done with the -r or --remove command.
When configuration files are to be removed, the -P or --purge command can be used
instead. Both commands can also be used to specify multiple packages to remove:
# dpkg --remove lsof
or
# dpkg --purge lsof
Querying the Package Database
You will often need to obtain more information about packages that are already installed on your
system. Because these operations do not modify the package database, they can be done as a nonroot
user.
To list all packages known to dpkg, use the -l or --list command:
$ dpkg --list
You can restrict the list by specifying a glob pattern:
$ dpkg --list "*lsof*"
The quotes are used to prevent the shell from replacing the wildcard with a list of
matching files in the current directory. For more information about wildcards, see
Chapter 2 or type man 7 glob to see a list of wildcards.
NOTE
321
Running Debian GNU/Linux 9
To view detailed information about a specific package, use the -s or --status command:
$ dpkg --status lsof
Package: lsof
Status: install ok installed
Priority: standard
Section: utils
...
The origin package for a file can be determined using the -S or --search command:
$ dpkg --search /bin/ls
coreutils: /bin/ls
The list of files in an installed package can be viewed using the -L or --listfiles command:
$ dpkg --listfiles lsof
/.
Pages:
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662