Search

Debfoster: Remove a package and its dependencies

November 11th, 2007 edited by Wolfger

Article submitted by Alex Chekholko. Please help DPOTD by submitting good articles about software you like!

We recently ran a review on Deborphan. Here is a review on a similar tool: Debfoster. Debfoster exists to tell you which packages are installed on your machine merely as dependencies for other packages. It then gives you the option of removing the package and its dependencies. It also remembers your previous responses so that it does not ask you about the same packages each time.

Debfoster is most useful to keep your system very lean. However, with today’s large disks, it is more of an aesthetic utility.

The use of Debfoster is best illustrated by a simple example. See the manpage for more details. This example assumes that you already ran Debfoster and told it to keep all your existing packages, otherwise it will ask you about all of them.

I will look at the dependencies for a package called munin, then install it (and its dependencies), then use Debfoster to remove it.

$ apt-cache show munin
Package: munin
Priority: optional
Section: universe/net
Installed-Size: 996
Maintainer: Ubuntu MOTU Developers
Original-Maintainer: Munin Debian Maintainers
Architecture: all
Version: 1.2.5-1
Depends: perl (>= 5.6.0-16), perl-modules (>= 5.8.0) |
libparse-recdescent-perl, librrds-perl, libhtml-template-perl,
libdigest-md5-perl, libtime-hires-perl, libstorable-perl, rrdtool,
adduser
Recommends: munin-node, libdate-manip-perl
Suggests: www-browser, httpd

$ sudo apt-get install munin
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libhtml-template-perl librrd2 librrds-perl rrdtool
Suggested packages:
libipc-sharedcache-perl httpd
Recommended packages:
munin-node libdate-manip-perl
The following NEW packages will be installed:
libhtml-template-perl librrd2 librrds-perl munin rrdtool
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.

$ sudo debfoster

munin is keeping the following 4 packages installed:
libhtml-template-perl librrd2 librrds-perl rrdtool
Keep munin? [Ynpsiuqx?], [H]elp: N
Keep librrds-perl? [Ynpsiuqx?], [H]elp: N

rrdtool is keeping the following 1 packages installed:
librrd2
Keep rrdtool? [Ynpsiuqx?], [H]elp: N
Keep libhtml-template-perl? [Ynpsiuqx?], [H]elp: N
Keep librrd2? [Ynpsiuqx?], [H]elp: N
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
libhtml-template-perl* librrd2* librrds-perl* munin* rrdtool*
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.

As you can see, Debfoster can help you clean up the packages that were
installed as dependencies. However, this functionality also exists in
aptitude and synaptic. Current versions of Aptitude or Synaptic will auto-remove the packages that were
installed as dependencies, negating the need for Debfoster. See Google: “aptitude vs apt-get” for more info.

Debfoster in all supported versions of Debian and Ubuntu.

Posted in Debian, Ubuntu |

5 Responses

  1. Matt Says:

    Thank you for the post.

    This was one of my favorite Debian programs of all time. I liked it because it was fast and simple and let me review top-level dependencies easily.

    I was sorry to see it deprecated by Aptitude, which unfortunately takes significantly longer to learn and makes this simple task much more difficult.

  2. Linulin Says:

    “I was sorry to see it deprecated by Aptitude, which unfortunately takes significantly longer to learn and makes this simple task much more difficult.”

    $ sudo aptitude install munin
    $ sudo aptitude remove munin

    What could be easier?

  3. Camila Acolide Says:

    Thank you.
    Thank you.
    Thank you!

    That was EXACTLY what I been looking for since I started using Ubuntu in Dapper.

    I am “a little” perfectionist, and a tidy computer with the minimum necessary cruft is a MUST! =)

    I used to have a script called UbuntuLite.sh which I updated at each new version, but now I can finally remove some Ubuntu default programs and ALL of its dependent libraries without effort!

    Thank you!

  4. Bloomingdale Says:

    sudo apt-get autoremove does the same thing, that is, removes packages not used, like so:

    sudo apt-get install munin : installs some packages
    sudo apt-get remove munin : removes munin, but not dependants

    sudo apt-get autoremove : removes the dependants…

  5. Bart Says:

    “However, with today’s large disks, it is more of an aesthetic utility.”

    There are plenty of hosted Virtual Server plans here with limited disk space. This utility is golden for those in such a situation.