So you would think that just removing a package from your Debian system would remove all the configuration files and other related files associated with that package, right? But that is not the case. There is a difference between “purging” and “removing” in Debian. As far as I understand, removing a package by the following command:

# dpkg --remove gedit
or
# apt-get remove gedit

does not remove the configuration files that comes with gedit package.

If you want to remove everything including configuration files when you want to delete a package then use the following commands:

# dpkg --purge gedit
or
# apt-get purge gedit

So let’s see what happened to my Debian “Squeeze” system over a period of 3 months:

# dpkg -l | grep ^rc

Output:

rc  bluez-audio                          3.36-3                     Bluetooth audio support
rc  bluez-gnome                          0.27-1                     Bluetooth utilities for GNOME
rc  bluez-utils                          3.36-3                     Bluetooth tools and daemons
rc  dasher-data                          4.10.1-1                   Data files for dasher
rc  empathy                              2.26.2-1                   High-level library and user-interface for Telepathy
rc  freeglut3                            2.4.0-8                    OpenGL Utility Toolkit
rc  gedit                                2.26.1-1                   official text editor of the GNOME desktop environment
rc  gnochm                               0.9.11-3                   CHM file viewer for GNOME
rc  gnome-accessibility-themes           2.26.2-1                   accessibility themes for the GNOME desktop
rc  gnome-app-install                    0.5.24-1                   GNOME Application Installer
rc  gnome-codec-install                  0.3.3                      GStreamer codec installer
rc  gnome-network-admin                  2.22.1-4                   GNOME Network Administration Tool
rc  gnome-vfs-obexftp                    0.4-1                      GNOME VFS module for OBEX FTP
rc  gok                                  2.26.0-1                   GNOME Onscreen Keyboard
rc  gparted                              0.4.6-2                    GNOME partition editor
rc  gthumb                               3:2.10.11-2                an image viewer and browser
rc  gvfs-bin                             1.2.3-3                    userspace virtual filesystem - binaries
rc  lesstif2                             1:0.95.0-2.3               OSF/Motif 2.1 implementation released under LGPL
rc  libatspi1.0-0                        1.26.0-1                   C binding libraries of at-spi for GNOME Accessibility
rc  libbeecrypt6                         4.1.2-8                    open source C library of cryptographic algorithms
rc  libbind9-40                          1:9.5.1.dfsg.P2-1+lenny1   BIND9 Shared Library used by BIND
rc  libbrlapi0.5                         4.0-7+b1                   braille display access via BRLTTY - shared library
rc  libbtctl4                            0.10.0-1                   GObject Bluetooth library
rc  libclutter-0.8-0                     0.8.8-2                    Open GL based interactive canvas library
rc  libclutter-cairo-0.8-0               0.8.2-1                    Open GL based interactive canvas library Cairo integrat
rc  libclutter-gtk-0.8-0                 0.8.3-1                    Open GL based interactive canvas library GTK+ widget
rc  libcolamd-3.2.0                      1:3.2.0-4                  column approximate minimum degree ordering library for
rc  libcolorblind0                       0.0.1-1                    Pixel Filter for colorblind accessibility
rc  libdns45                             1:9.5.1.dfsg.P2-1+lenny1   DNS Shared Library used by BIND
rc  libdvbpsi4                           0.1.5-3.1                  library for MPEG TS and DVB PSI tables decoding and gen
rc  libespeak1                           1.41.01-1                  A multi-lingual software speech synthesizer: shared lib
rc  libestools1.2                        1:1.2.96~beta-4            Edinburgh Speech Tools Library
rc  libevent1                            1.3e-3                     An asynchronous event notification library
rc  libgconfmm-2.6-1c2                   2.24.0-2                   C++ wrappers for GConf (shared library)
rc  libglademm-2.4-1c2a                  2.6.7-2                    C++ wrappers for libglade2 (shared library)
rc  libgnome-mag2                        1:0.15.8-1                 screen magnification library for the GNOME desktop (sha
rc  libgnome-speech7                     1:0.4.25-1                 GNOME text-to-speech library
rc  libgnomebt0                          0.9.1-1                    GNOME Bluetooth library
rc  libgtkglext1                         1.2.0-1                    OpenGL Extension to GTK+ (shared libraries)
rc  libisc45                             1:9.5.1.dfsg.P2-1+lenny1   ISC Shared Library used by BIND
rc  libisccc40                           1:9.5.1.dfsg.P2-1+lenny1   Command Channel Library used by BIND
rc  libisccfg40                          1:9.5.1.dfsg.P2-1+lenny1   Config File Handling Library used by BIND
rc  libiso9660-5                         0.78.2+dfsg1-3             library to work with ISO9660 filesystems
rc  libjinglebase0.3-0                   0.3.11-5                   Libjingle base library
rc  libjinglep2p0.3-0                    0.3.11-5                   Libjingle p2p
rc  libjinglexmllite0.3-0                0.3.11-5                   Libjingle XMLLite library
rc  libjinglexmpp0.3-0                   0.3.11-5                   Libjingle XMPP library
rc  liblwres40                           1:9.5.1.dfsg.P2-1+lenny1   Lightweight Resolver Library used by BIND
rc  libopal3.6.1                         3.6.1~dfsg-1               Open Phone Abstraction Library - successor of OpenH323
rc  libparted1.8-10                      1.8.8.git.2008.03.24-11.1  The GNU Parted disk partitioning shared library
rc  libparted1.8-12                      1.8.8.git.2009.07.19-5     The GNU Parted disk partitioning shared library
rc  libportaudio2                        19+svn20071022-3+b1        Portable audio I/O - shared library
rc  libpt2.6.1                           2.6.1-2                    Portable Tools Library
rc  librpm4.4                            4.4.2.3-1                  RPM shared library
rc  libsdl-gfx1.2-4                      2.0.19-2                   drawing and graphical effects extension for SDL
rc  libsdl-net1.2                        1.2.7-2                    network library for Simple DirectMedia Layer
rc  libsdl-ttf2.0-0                      2.0.9-1                    ttf library for Simple DirectMedia Layer with FreeType
rc  libsmbios2                           2.0.3.dfsg-1               Provide access to (SM)BIOS information -- dynamic libra
rc  libvdemgmt0                          2.2.2-3                    Virtual Distributed Ethernet - Management console libra
rc  libwxbase2.6-0                       2.6.3.2.2-3                wxBase library (runtime) - non-GUI support classes of w
rc  libwxgtk2.6-0                        2.6.3.2.2-3                wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
rc  libxmmsclient4                       0.5DrLecter-2.1            XMMS2 - client library
rc  libxp6                               1:1.0.0.xsf1-2             X Printing Extension (Xprint) client library
rc  liferea                              1.4.27-1                   feed aggregator for GNOME
rc  mono-common                          2.0.1-6                    common files for Mono
rc  mousetweaks                          2.26.2-1                   mouse accessibility enhancements for the GNOME desktop
rc  openbsd-inetd                        0.20080125-3               The OpenBSD Internet Superserver
rc  padevchooser                         0.9.3-2                    PulseAudio Device Chooser
rc  paman                                0.9.4-1                    PulseAudio Manager
rc  paprefs                              0.9.8-1                    PulseAudio Preferences
rc  pavumeter                            0.9.3-1                    PulseAudio Volume Meter
rc  planner                              0.14.4-1                   project management application
rc  python-twisted-core                  8.2.0-3                    Event-based framework for internet applications
rc  qstat                                2.11-1                     Command-line tool for querying quake (and other) server
rc  scrollkeeper                         0.3.14-16                  A free electronic cataloging system for documentation
rc  seahorse-plugins                     2.26.1-1                   seahorse plugins and utilities for encryption in GNOME
rc  software-properties-gtk              0.60.debian-1.1            manage the repositories that you install software from
rc  swfdec-gnome                         2.26.0-1                   Tools to play SWF files (Macromedia Flash) on GNOME
rc  synaptic                             0.62.7+b1                  Graphical package manager
rc  transmission-gtk                     1.74-1                     lightweight BitTorrent client (GTK interface)
rc  unattended-upgrades                  0.42debian1                automatic installation of security upgrades
rc  update-manager                       0.68.debian-7              GNOME application that manages software updates
rc  update-notifier                      0.70.7.debian-5            Daemon which notifies about package updates
rc  update-notifier-common               0.70.7.debian-6            Files shared between update-notifier and adept
rc  xpdf-common                          3.02-1.4+lenny1            Portable Document Format (PDF) suite -- common files
rc  xpdf-reader                          3.02-1.4+lenny1            Portable Document Format (PDF) suite -- viewer for X11
rc  xqf                                  1.0.5-1                    X-based Quake Server Browser
rc  xsane                                0.996-2                    featureful graphical frontend for SANE (Scanner Access

So basically the two letters, rc, at the beginning of each line tells us that the package is removed from the system but there are still some configuration files that are left on your system. As you can there are approximately 88 such packages in my system whose config files are still left on the system.

Now one way to remove the config files would be to give “dpkg –purge <package>” command for each of the package. However that would be too tedious. But there is a better way to achieve this just by giving one single command:

# dpkg -l | grep ^rc | cut -d ' ' -f3 | xargs dpkg --purge

That’s it! Now you can see your all the configuration files also being removed.

Happy Purging!

Be Sociable, Share!