Ubuntu Package management Using dpkg

Sponsored Link
Dpkg is the Ubuntu package manager dpkg is a medium-level tool to install, build, remove and manage Ubuntu packages. The primary and more user-friendly front-end for dpkg is dselect.dpkg itself is controlled entirely via command line parameters,which consist of exactly one action and zero or more options. The action-parameter tells dpkg what to do and options control the behavior of the action in some way.

Now we will see all the available commands for dpkg with examples

1) Install a package


dpkg -i <.deb file name>


dpkg -i avg71flm_r28-1_i386.deb

2) Install all packages recursively from a directory


dpkg -R


dpkg -R /usr/local/src

3) Unpack the package, but don't configure it.


dpkg --unpack package_file

If you use -R option is specified, package_file must refer to a directory instead.


dpkg --unpack avg71flm_r28-1_i386.deb

4) Reconfigure an unpacked package


dpkg --configure package

If -a is given instead of package, all unpacked but uncon-figured packages are configured.


dpkg --configure avg71flm_r28-1_i386.deb

5) Remove an installed package except configuration files


dpkg -r


dpkg -r avg71flm_r28-1_i386.deb

6) Remove an installed package including configuration files


dpkg -P

If you use -a is given instead of a package name, then all packages unpacked, but marked to be removed or purged in file /var/lib/dpkg/status, are removed or purged, respectively.


dpkg -P avg71flm

7) Replace available packages info


dpkg --update-avail <Packages-file>

With this option old information is replaced with the information in the Packages-file.

8) Merge with info from file


dpkg --merge-avail <Packages-file>

With this option old informa-tion is combined with information from Packages-file.

The Packages-file distributed with Debian is simply named Packages.dpkg keeps its record of available packages in /var/lib/dpkg/available.

9) Update dpkg and dselect's idea of which packages are available with information from the package pack-age_file.


dpkg -A package_file

10) Forget about uninstalled unavailable packages.


dpkg --forget-old-unavail

11) Erase the existing information about what packages are available.


dpkg --clear-avail

12) Searches for packages that have been installed only partially on your system.


dpkg -C

13) Compare Package versions version numbers


dpkg --compare-versions ver1 op ver2

14) Display a brief help message.


dpkg --help

15) Display dpkg licence.


dpkg --licence (or) dpkg --license

16) Display dpkg version information.


dpkg --version

17) Build a deb package.


dpkg -b directory [filename]

18) List contents of a deb package.


dpkg -c filename

19) Show information about a package.


dpkg -I filename [control-file]

20) List packages matching given pattern.


dpkg -l package-name-pattern


dpkg -l vim

21) List all installed packages, along with package version and short description


dpkg -l

22) Report status of specified package.


dpkg -s package-name


dpkg -s ssh

23) List files installed to your system from package.


dpkg -L package-Name


dpkg -L nagios2

24) Search for a filename from installed packages.


dpkg -S filename-search-pattern


dpkg -S /sbin/ifconfig

25) Display details about package


dpkg -p package-name


dpkg -p nagios2

Sponsored Link

You may also like...

3 Responses

  1. Toshio says:

    On Linux systems where dpkg is installed, mc (Midnight Commander) is a very convenient way of browsing the contents of a .deb file.
    On an unrelated note, but by the same token, it’s possible to browse the contents of .rpm files on Ubuntu/Debian using mc if you have the rpm package installed on your system.

  2. Moinul Abrar says:

    Please help me.
    Sub: “No network device available” – in Ubuntu 9.10 karmic.

    1. When in Window-7 Ultimate and Windows XP mode, then internet connection is established successfully (using Nokia 3110c mobile set via bluetooth connection.)

    2. When my PC is running in UBUNTU 9.10 Karmic, then I can’t established internet connection by using Nokia 3110c mobile set to PC via bluetooth connection. When click in Network Manager icon on top of the Ubuntu desktop, there is “No network device is available” is display. But,Mobile to PC bluetooth connection is OK. I can easily brouce my Mobile set’s Files Directory via bluetooth connection. My NOKIA 3110c mobile set is discovered by my computer.

    This is my office PC. Processor: Intel Pentium-4,2.39GHz, RAM: 512 MB

    In my “Home Computer”, I’m using UBUNTU 9.10 Karmic (my 1st choice) and Windows XP Pro. Processor: Intel Core-2 Duo, 1.8GHz, RAM: 04 GB. In my home PC, I can easily establish Internet connection in both UBUNTU and Windows XP (via NOKIA 3110c – Bluetooth- Home Pc. In both office & home I’m use same my NOKIA 3110c mobile set. This is my only one moblie set. Please, help me.
    With Thanks-

    Moinul Abrar
    Chittagong, Bangladesh
    [email protected]

  3. logico says:

    hai moinul akbar.
    You have to check weather the networking is enabled in the network manager’s option. Right click on the network manager icon in desktop panel and enable networking and wireless networking, if they are not. Hope solved

Leave a Reply

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