<br /> Handy packaging commands – Debian Planet

Welcome to Debian Planet

News for Debian. Stuff that *really* matters

Sponsorship

Debian Planet is hosted by Bluelinux Internet Services Ltd. Offering a special discounted rate for Free and Open Source software community members.

Buy your Debian merchandise at DebianShop.com.

Debian
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
    (apt-get.org)

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

  • Planet Debian
  • debianHELP
    (User support site)

  • Debian Administration
    (SysAdmin resources)

  • Debian International
  • DebianForum.de
    (Deutsch)

  • DebianForum.dk
    (Dansk)

  • EsDebian
    (Español)

  • DebianWorld
    (Français)

  • Debian-Fr
    (Français)

  • MaximumDebian
    (Italiano)

  • DebianItalia
    (Italiano)
  • DebianUsers
    (한국어)

  • Debian-BR
    (Português)

  • DebianHOWTO
    (Deutsch)

  • Russian Debian (Русский)
  • Debian-JP
    (日本語)
  • Debian Suisse
    (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

    IRC
    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.

    Syndicate
    XML

    Handy packaging commands
    Submitted by Anonymous on Monday, November 20, 2000 – 18:21
    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?


    Netsnipe: Update (10:22GMT) – Sorry I’ve been out of the loop recently, too busy organising for my school formal and rebuilding my box. It would seem like a record number of users from .rpm-based distros have just converted to Debian and asking about the magnificent .deb system on #debian. So within this week I’ll have my guide to Debian package management and a review of the coolest tools up. So hold on a little longer!

    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 package?

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

      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.

    Control panel

    Comment viewing options:



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

    Subject: Re: Handy packaging commands
    Author: captainlarry
    Date: Tuesday, 2000/11/28 – 03:28
    i’m not sure if i got this too late and nobody will see it but in case anyone does i’ve had an email that i send to friends when they start out with debian that describes similar info but in a lot more detail and more of it.

    this posting prompted me to tidy it up and htmlize it. for those that are interested you can find it here.


    http://www.spack.org/geek/apt-help.html
    .

    [ Please login, or register ]

    Subject: dlocate – do it the fast way
    Author: surf
    Date: Thursday, 2000/11/23 – 21:54
    dlocate emulates most of the dpkg query commands, and does some new things as well.

    But it uses a locate database (install anacron if your box is not up 24h a day to make it rebuild regulary).

    And this makes it faster than dpkg or apt-cache.

    [times without I/O effects]

    $ time dpkg -L dpkg > /dev/null

    real 0m0.576s
    user 0m0.550s
    sys 0m0.010s

    $ time dlocate -L dpkg > /dev/null

    real 0m0.025s
    user 0m0.010s
    sys 0m0.020s

    [ Please login, or register ]

    Subject: Re: Handy packaging commands
    Author: prakash
    Date: Tuesday, 2000/11/21 – 18:39
    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 package?

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

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

    apt-get -s remove XYZ

    Another way to find out which packages depend on package XYZ:

    apt-cache showpkg XYZ

    This shows a bunch of info about the package. One section in the output is Reverse Depends: which shows what other packages depend on package XYZ. One caveat is that it shows all the packages that depend on package XYZ, whether they are installed or not.

    There are other cool uses for apt-cache:

    apt-cache show XYZ

    This will display the information about package XYZ from the Packages file, same as dpkg -p XYZ but with one difference. dpkg -p shows the info about the package that is installed, but if a later version of the package is avilable apt-cache show will also show that info (provided you have an up-to-date packages list). For example, I have eterm version 0.9.0-8 installed. But version 0.9.0-9 is available in ‘unstable’. Then apt-cache show will show info about both versions.

    Another very useful option is search:

    apt-cache search postgres

    will search the package database and lists all the packages whose name/description etc. contains the string postgres. This is somewhat similar to dpkg -l *postgres*, but gives you better output. You can also use regular expressions in place of the search string.

    There are other options that are worth exploring.

    /prakash

    [ Please login, or register ]

    Subject: Re: Handy packaging commands
    Author: shaleh
    Date: Tuesday, 2000/11/21 – 18:01
    in woody, there is now a package call ‘deborphan’. It will tell you if a library is not needed any more. If you give deborphan options, can tell you about any unneeded packages or even show a depends tree. So if you decide that GNOME is not needed anymore, you can see what packages to remove quite easily.
    [ Please login, or register ]

    Subject: Re: Handy packaging commands
    Author: riotnrrd
    Date: Tuesday, 2000/11/21 – 16:41
    dpkg -l tcl*

    The backslash is required so that the * gets through to dpkg untouched by the shell
    though you remembered to mention the backslash, it looks to me as though you forgot to actually include it…
    and i agree about this going into tips and tricks (although it definitely ought to be expanded upon).

    [ Please login, or register ]

    Subject: Re: Handy packaging commands
    Author: ressu
    Date: Monday, 2000/11/20 – 19:14
    This is most definitely worth going to ‘tips ‘n tricks’..

    keep it up..

    [ Please login, or register ]

     

    Subject: Re: Handy packaging commands
    Author: Mozillion
    Date: Monday, 2000/11/20 – 22:02
    Don’t forget dlocate (woody only 🙁
    it’s fast AND handy 🙂

    Usage: dlocate [option] [string…]

    Options:
    (no option) string list all records that match
    -S string list records where files match
    -L package list all files in package
    -l package almost-emulation of ‘dpkg -l’
    -s package print package’s status
    -ls package ‘ls -ldF’ of all files in package
    -du package ‘du -sck’ of all files in package
    -conf package list conffiles in package
    -lsconf package ‘ls -ldF’ of conffiles in package
    -md5sum package list package’s md5sums (if any)
    -md5check package check package’s md5sums (if any)
    -man package list package’s man pages (if any)

    The -L, -s, and -S commands are roughly analagous to the
    equivalent dpkg commands.

    [ Please login, or register ]

     

    Subject: Re: Handy packaging commands
    Author: kraai
    Date: Monday, 2000/11/20 – 20:41
    You can get information about which packages depend on a package by running

    apt-cache showpkg package

    and looking at the reverse dependency information.

    [ Please login, or register ]

    Search articles



    Category
    ·News (406)
    ·Features (5)
    ·Site News (16)
    ·HOWTOs (79)
    ·Tips (21)
    ·Opinion (29)
    ·Q & A (35)
    ·Sponsorship (1)
    ·Press Releases (5)

    Log in
    Username:

    Password:

    Remember me

    » Register
    » New password

    Debian Security Announcements
    DSA-943 perl
    DSA-942 albatross
    DSA-903 unzip
    DSA-941 tuxpaint
    DSA-940 gpdf
    DSA-939 fetchmail
    DSA-938 koffice
    DSA-937 tetex-bin
    DSA-936 libextractor
    DSA-935 libapache2-mod-auth-pgsql

    Planet Debian
    Wouter Verhelst: On flames.
    Joachim Breitner: Fixing my planet.debian.org subscription
    Steve Kemp: She has the blood of reptile just underneath her skin
    Pierre Habouzit: Married …
    Pierre Habouzit: whitelister 0.4 (SPF) and aaege ….
    Pierre Habouzit: kde 3.4.1 upload
    Holger Levsen: In case you are running OpenWRT
    Michael Janssen: Shiny roofs are good for the environment!
    Matthew Palmer: Work it out yourself, dammit!
    Axel Beckert: Tell me which music you like and I tell who you are

    Debian Administration
    How do I prevent rebuilt packages from being upgraded?
    Disabling the print-screen key inside X?
    Monitoring your bandwidth usage with vnstat
    Ruby on Rails on Debian
    Choice for Virtual Private Servers?
    Monitoring your hardware’s temperature
    Sending mail with Exim from ‘dialup’ IP
    How to recover GRUB Debian Sarge after reinstalling Windows
    Getting a GUI
    Spam filtering with Pyzor and SpamBayes

    Latest poll: Which release scheme should Debian follow?
    Continue this way (release when ready)
    48%
     
    Give up on releasing
    8%
       
    Split the release up
    8%
       
    Speed the release up
    32%
       
    Crank the workload up (see DebianWiki ReleaseProposals for details on these)
    4%
       

    Total votes: 372
    0 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.