Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

It is currently Mon Jul 13, 2020 1:43 pm

Message body:
Enter your message here, it may contain no more than 60000 characters. 

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.

Topic review - Debian: Quick dpkg query commands
Author Message
Post subject: Debian: Quick dpkg query commands  |  Post Posted: Thu Aug 06, 2009 7:16 am
Here are a few tricks for querying Debian's dpkg command.

Upgrade or install a package:
# dpkg -i package-name.deb

Listing installed packages in Debian. You can use directly package name after '-l' if you know it's name.:
# dpkg -l
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                                         Version                      Description
ii  acl                                          2.2.47-3                     Access control list utilities
ii  acpi                                         1.4-2                        displays information on ACPI devices
ii  acpi-support-base                            0.123-1                      scripts for handling base ACPI events such a
ii  acpid                                        1.0.10-2                     Utilities for using ACPI power management
ii  adduser                                      3.110                        add and remove users and groups

Install recursivelly all packages from this directory:
# dpkg -R .
(notice the dot).
Completely remove a package (including configuration files):
# dpkg -P (--purge) package-name.deb

Remove a package leaving it's configuration file intact:
# dpkg -r (--remove) package-name.deb

List all files installed by a certain package:
# dpkg -L initramfs-tools

Find out by which packages was this file installed:
# dpkg -S `which update-initramfs`
initramfs-tools: /usr/sbin/update-initramfs

List all files included in a .deb file without installing it.Here's how to list the contents of a kernel debian package:
# dpkg -c /usr/src/linux-image-2.6.26-compiled-tuned_debian.resa.1.0_i386.deb | head
tar: Record size = 8 blocks
drwxr-xr-x root/root         0 2009-08-04 10:53 ./
drwxr-xr-x root/root         0 2009-08-04 10:53 ./boot/
-rw-r--r-- root/root     87142 2009-08-04 10:03 ./boot/config-2.6.26-compiled-tuned
-rw-r--r-- root/root    900061 2009-08-04 10:53 ./boot/
-rw-r--r-- root/root   1450992 2009-08-04 10:53 ./boot/vmlinuz-2.6.26-compiled-tuned
drwxr-xr-x root/root         0 2009-08-04 10:53 ./lib/
drwxr-xr-x root/root         0 2009-08-04 10:53 ./lib/modules/
drwxr-xr-x root/root         0 2009-08-04 10:53 ./lib/modules/2.6.26-compiled-tuned/
-rw-r--r-- root/root    391518 2009-08-04 10:53 ./lib/modules/2.6.26-compiled-tuned/modules.alias.bin
-rw-r--r-- root/root    222088 2009-08-04 10:53 ./lib/modules/2.6.26-compiled-tuned/modules.symbols.bin

List information (dependencies, maintainer, architecture, description) about an installed package
# dpkg -p virtualbox-ose
Package: virtualbox-ose
Priority: extra
Section: misc
Installed-Size: 22712
Maintainer: Debian Virtualbox Team <>
Architecture: i386
Version: 3.0.2-dfsg-1
Replaces: virtualbox
Provides: virtualbox
Depends: libc6 (>= 2.3.6-6~), libcurl3 (>= 7.16.2-1), libgcc1 (>= 1:4.1.1), libsdl1.2debian (>= 1.2.10-1), libssl0.9.8 (>= 0.9.8f-5), libstdc++6 (>= 4.2.1), libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxml2 (>= 2.6.27), libxmu6, libxslt1.1 (>= 1.1.18), libxt6, python2.5 (>= 2.5), zlib1g (>= 1:1.1.4), adduser, python
Pre-Depends: debconf | debconf-2.0
Recommends: virtualbox-ose-modules, virtualbox-ose-qt, libgl1
Suggests: virtualbox-ose-source, virtualbox-guest-additions
Conflicts: virtualbox
Size: 5891154
Description: x86 virtualization solution - base binaries
VirtualBox is a free x86 virtualization solution allowing a wide range
of x86 operating systems such as Windows, DOS, BSD or Linux to run on a
Linux system.
This package provides the binaries for the Open Source Edition of
VirtualBox. The virtualbox-ose-source package is also required in order to
compile the kernel modules needed for virtualbox-ose. A graphical user
interface for VirtualBox is provided by the package virtualbox-ose-qt.
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list

Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]