15 Practical Examples of “dpkg commands” for Debian Based Distros

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

10 Responses

  1. Hedley Finger says:

    I would like to remove some of the columns from the output of dpkg -l. I would also like to list just the packages I installed manually after a fresh Ubuntu installation or upgrade.

  2. aptee says:

    I’ve installed cinnamon on my raspi 3 I’m a newbie, how do I extract it? where is it, I’ve tried all the above but to no avail.

  3. Khach says:

    I have got this error. How to solve it?

    Setting up gnome-menus (3.13.3-9) …
    /var/lib/dpkg/info/gnome-menus.postinst: 10: /var/lib/dpkg/info/gnome-menus.postinst: gnome-menus-blacklist: not found
    dpkg: error processing package gnome-menus (–configure):
    subprocess installed post-installation script returned error exit status 127
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  4. riajul Islam says:

    this is a perfect article.

  5. Raj says:

    To remove a package with configuration I think it is “-P” in caps. which is –purge. Removes a package including configuration files.

  6. Martin Goik says:

    An example getting the package owning a specific file or directory might be helpful i.e.:

    dpkg -S /usr/bin/nice
    –>coreutils: /usr/bin/nice

    At least I need this one occasionally for administrative purposes.

  7. visoos says:



  8. James Mac says:


    1. dkpg is still a pre-requisite for passing LPIC-1 certification.

    2. It’s largely distro-neutral. Sure, I can bypass dpkg on my Ubuntu machine by just using Ubuntu Software Centre (built over Synaptic, which is built over APT, which is built over dpkg), but the day I hit a non-Ubuntu Debian, I’m stuffed – unless I go back to source.

    3. APT may be smarter (do you really mean “more user-friendly”?) but I think dpkg gives you more control, and for an administrator that would matter more.

  9. LinuxEnthusiastic says:

    Who use dpkg??

    well APT is much smarter.

  10. FossEnthusiastic says:

    Well I Think, This article could have been a bit more Elaborative.

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.