<br /> Handy commands to access packages – Debian Planet

Welcome to Debian Planet

News for Debian. Stuff that *really* matters

These are important Debian sites one should not be without!

  • Official Debian site
  • Package search
  • Mailing list archives
  • Bug reports
  • Debian on CD
  • Debian Weekly News — excellent news source!
  • Unofficial APT sources

  • Developers’ Corner
  • Community
    Need help? You’re not alone on this planet.

  • Planet Debian
  • debianHELP
    (User support site)

  • Debian International
  • DebianForum.de

  • DebianForum.dk

  • EsDebian

  • DebianWorld

  • Debian-Fr

  • MaximumDebian

  • DebianUsers

  • Debian-BR

  • DebianHOWTO

  • Russian Debian
  • Debian-JP
  • Debian Suisse
  • Contribute
    Got that latest or greatest scoop? Perhaps you have some important news for the Debian community? Submit a news item!

    Or perhaps you’ve written a rather ground breaking insight into some aspect of Debian and you feel compelled to share it with others? Knock up a longer editorial article and send it to the editors.

    General feedback should be sent to staff@debianplanet.org

    The place to get help on a Debian problem (after reading docs) or to just chat and chill is #debian on irc.oftc.net.

    Many of the Debian Planet staff live there so pop by and say hello.

    Debian Planet also has its own channel on the same network called #debianplanet.


    DP is sponsored by Xinit Systems.

    Domains paid for and hosted by uklinux.net.

    Buy your Debian merchandise at DebianShop.com.

    Support Debian through Bytemark Hosting. At least £7 will be given for each new account


    Handy commands to access packages
    Submitted by robster on Monday, April 02, 2001 – 21:27
    Yep, so you’ve heard all about Debian’s super-duper packaging system,
    how it’s the best thing that ever happened in the Linux package manager world,
    etc., etc.. But how do you actually *use* the powerful tools?
    Here are some very useful commands that I’ve come to learn, but it took
    me quite a while to dig them up, so I’m posting it here in the hopes that
    it will be useful. To other Debian gurus: please add your suggestions/tips
    here too.

    • I’ve come across this file in /etc/something/or/other.txt,
      and I want to know which package it belongs to. How?

      dpkg -S /etc/something/or/other.txt

    • I want to find out what exactly is installed by package XYZ. How?

      dpkg -L XYZ

      This lists all the files installed by package XYZ. You can filter
      it through grep to obtain more specific information: for example,
      to list all the binaries provided by package XYZ, do this:

      dpkg -L XYZ | grep bin/

    • I’m tight on hard drive space, and package XYZ looks like a candidate
      for removal. How do I check which packages depend on it, so that I know
      whether or not it’s safe to remove? Or, how do I find out the size of a

      dpkg -p XYZ will print out the control information
      for a package. This includes which packages XYZ depends on, and the package

      But it doesn’t answer the whole question. So here’s what I do:

      apt-get -s remove XYZ

      Make sure you have the -s there!! This command will pretend to
      uninstall XYZ, and apt-get will tell you what other packages (if any) will
      be removed if you remove XYZ. This means that the other packages depend
      on XYZ. If apt-get doesn’t list any other packages to be removed, it means
      that nothing depends on XYZ. However, you should check the package description
      (dpkg -p XYZ) to make sure that XYZ isn’t part of something you
      actually use or need.

    • I’ve recently upgraded/installed a lot of packages, and my
      /var partition seems to be filling up real fast! What’s happening?
      What’s happening? apt-get is caching the package files it downloaded, in /var/apt/cache/….
      If you have a small /var partition (like me), it’s useful to occasionally
      clean it out:

      apt-get clean

    • Here’s a not-so-well-known fact about dpkg: it understands
      shell globbing metacharacters (such as the wildcard *). For example, here’s
      one way to list all Tcl packages:

      dpkg -l 'tcl*'

      The backslash is required so that the * gets through to dpkg
      untouched by the shell, which might mistakenly think you’re trying to
      glob for a filename if you don’t have the backslash. update the article broke the backslash.. and we changed it to quotes.. (which is a better practise in some cases)

    Article was contributed by anonymous user

    Control panel

    Comment viewing options:

    Select your prefered way to display the comments and click ‘Update settings’ to activate your changes.

    Subject: wajig
    Author: Anonymous
    Date: Sunday, 2002/04/07 – 17:42
    Try wajig. It has a lot of nifty options for package management, and it even runs sudo for you when you’re doing something requiring root privileges.
    [ Please login, or register ]

    Subject: Re: Handy commands to access packages
    Author: danish
    Date: Sunday, 2001/06/10 – 21:49
    Note that there is a nice Debian package, dlocate, which runs faster than dpkg and performs many of the same searching operations (-l, -L, -S, etc.)
    [ Please login, or register ]


    Subject: Re: Handy commands to access packages
    Author: heffel
    Date: Tuesday, 2001/12/04 – 15:23
    I just migrated to Debian
    from Mandrake, before Mandrake,
    I had been using Red Hat for many years.

    apt was the main reason for the switch
    and I am not disappointed.

    I’m glad I don’t have to deal with the
    RPM dependency nightmare anymore.

    This article is very helpful
    to a Debian newcomer like me.


    [ Please login, or register ]


    Subject: Re: Handy commands to access packages
    Author: Anonymous
    Date: Thursday, 2002/03/07 – 14:44
    HOORAY!!! I’m in the same boat and I’m now a dedicated debian fan just after a couple of weeks of tinkering.
    [ Please login, or register ]

    Search articles

    ·News (282)
    ·Features (5)
    ·Site News (11)
    ·HOWTOs (50)
    ·Tips (11)
    ·Opinion (21)
    ·Q & A (21)
    ·Sponsorship (1)
    ·Press Releases

    Log in


    Remember me

    » Register
    » New password

    Debian Security Announcements
    DSA-527 pavuk
    DSA-526 webmin
    DSA-525 apache
    DSA-524 rlpr
    DSA-523 www-sql
    DSA-522 super
    DSA-521 sup
    DSA-520 krb5
    DSA-519 cvs
    DSA-518 kdelibs

    Planet Debian
    Sean Harshbarger: 15 Jul 2004
    Edd Dumbill: On the radar
    Gerfried Fuchs: Debian-Installer tried, Fillets NG, djb
    Mike Beattie: Making your Backup MX do recipient verification with Exim…
    Adam Kessel: PHP Perils
    Simon Law: OSM
    Marco d’Itri: Call for USB coldplugging testers
    Todd Troxell: >_<
    Steve McIntyre: JTE 1.6 released
    Debian Weekly News

    Latest poll: How often would you like to see a Debian release?
    3 months
    6 months
    9 months
    1 year
    1.5 years
    2 years
    3 years

    Total votes: 615
    8 comments · older polls

    home · archives · news feeds · about · polls · search · sections · user account

    Powered by the amazing Drupal

    Debian Planet is not officially related to the Debian Project.
    Debian and the Debian logo are trademarks of Software in the Public Interest, Inc.