DPKG Uninstall – Dependencies Still Exist in ‘dpkg -l’ After Running ‘apt-get remove’


I suspected that installing xfce4 cause some issues in Ubuntu so I removed them using apt-get remove xfce4 xfce4-goodeis.

But when I ran 'dpkg -l' I still can see some libraries and packages for xfce4:

$ dpkg -l | grep -i xfce
rc  libexo-1-0:amd64                              0.10.2-2                                 amd64        Library with extensions for Xfce
rc  libgarcon-1-0                                 0.2.1-1                                  amd64        freedesktop.org compliant menu implementation for Xfce
rc  libxfce4ui-1-0                                4.11.0-0ubuntu1~ppa0.13.10.1             amd64        widget library for Xfce - Gtk+2 variant
rc  libxfce4ui-common                             4.11.0-0ubuntu1~ppa0.13.10.1             all          common files for libxfce4ui
rc  libxfce4util6                                 4.10.1-1                                 amd64        Utility functions library for Xfce4
rc  libxfcegui4-4                                 4.10.0-2                                 amd64        Basic GUI C functions for Xfce4
rc  libxfconf-0-2                                 4.10.0-2                                 amd64        Client library for Xfce4 configure interface
rc  mousepad                                      0.3.0-2                                  amd64        simple Xfce oriented text editor
rc  thunar                                        1.6.3-1ubuntu1                           amd64        File Manager for Xfce
rc  xfce4-appfinder                               4.10.1-1                                 amd64        Application finder for the Xfce4 Desktop Environment
rc  xfce4-clipman                                 2:1.2.3-2ubuntu1                         amd64        clipboard history utility
rc  xfce4-mixer                                   1:4.10.0-1ubuntu2                        amd64        Xfce mixer application
rc  xfce4-notes                                   1.7.7-3ubuntu2                           amd64        Notes application for the Xfce4 desktop
rc  xfce4-panel                                   4.10.1-1ubuntu1                          amd64        panel for Xfce4 desktop environment
rc  xfce4-power-manager                           1.2.0-2ubuntu1                           amd64        power manager for Xfce desktop
rc  xfce4-session                                 4.10.1-1ubuntu1                          amd64        Xfce4 Session Manager
rc  xfce4-settings                                4.11.1-0ubuntu1~ppa0.13.10.1             amd64        graphical application for managing Xfce settings
rc  xfce4-terminal                                0.6.2-3ubuntu1.1                         amd64        Xfce terminal emulator
rc  xfce4-volumed                                 0.2.0-0ubuntu1                           amd64        volume keys daemon
rc  xfdesktop4                                    4.11.2-0ubuntu1~ppa0.13.10.1             amd64        xfce desktop background, icons and root menu manager
rc  xfwm4                                         4.11.1-0ubuntu1~ppa0.13.10.1             amd64        window manager of the Xfce project

I copy-pasted all these packages\libraries to form an apt-get remove command to remove all of these dependencies, and the command ran normally, but running dpkg -l | grep -i xfce showed these dependencies again !

Why are these dependencies still installed ?

Best Answer

Note the rc at the beginning of the list.

r: Remove (marked for removal)
c: Configuration files are present.

The difference between apt-get remove and purge (From man apt-get)

       remove is identical to install except that packages are removed instead of installed.
       Note the removing a package leaves its configuration files in system.

       purge is identical to remove except that packages are removed and purged (any
       configuration files are deleted too).

As you choose to apt-get remove, your dpkg -l reflecting that. If you would have been used apt-get purge you could avoid such a situation. To get rid of these, try in terminal,

dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge

It will purge all the packages which are marked for removal. Before you purge them you can check the list which you are going to purge using,

dpkg --list | grep "^rc" | cut -d " " -f 3 

I guess you have no other package remain marked for removal except those are from xfce. If you are not sure about it. Use the following instead,

dpkg --list | grep -i xfce | cut -d " " -f 3 | xargs sudo dpkg --purge
Related Question