aptitude doesn't remove unused packages
Debian's package management should remove packages that were installed
automatically, if they are no longer needed. Unfortunately, that
often seems to not work correctly. See this example on my Raspberry
Pi running Raspbian jessie:
Some time in the past there were probably packages that needed
gcc-4.8-base so it were installed automatically:
# aptitude show gcc-4.8-base
Package: gcc-4.8-base
State: installed
Automatically installed: yes
Multi-Arch: same
Version: 4.8.4-1
Priority: required
Section: libs
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: armhf
Uncompressed Size: 176 k
Breaks: dehydra (<= 0.9.hg20110609-2), gcc-4.4-base (< 4.4.7), gcc-4.7-base (< 4.7.3),
gcj-4.4-base (< 4.4.6-9~), gcj-4.6-base (< 4.6.1-4~), gnat-4.4-base (< 4.4.6-3~),
gnat-4.6 (< 4.6.1-5~)
Description: GCC, the GNU Compiler Collection (base package)
This package contains files common to all languages and libraries contained in the GNU Compiler
Collection (GCC).
Homepage: http://gcc.gnu.org/
But after many updates/upgrades no installed package needs
gcc-4.8-base anymore but it hasn't been removed. If I check why it's
still installed I get:
# aptitude why gcc-4.8-base
i cron Recommends exim4 | postfix | mail-transport-agent
p courier-mta Provides mail-transport-agent
p courier-mta Depends courier-authlib (>= 0.66.1-1)
p courier-authlib Depends expect
p expect Recommends tk8.6
p tk8.6 Recommends xterm | x-terminal-emulator
p gnome-terminal Provides x-terminal-emulator
p gnome-terminal Recommends gvfs
p gvfs Depends gvfs-daemons (< 1.22.2-1+deb8u1.1~)
p gvfs-daemons Recommends policykit-1-gnome
p lxsession Provides policykit-1-gnome
p lxsession Recommends openbox | x-window-manager
p xmonad Provides x-window-manager
p xmonad Recommends libghc-xmonad-dev
p libghc-xmonad-dev Depends libghc-unix-dev-2.6.0.1-7550b
p ghc Provides libghc-unix-dev-2.6.0.1-7550b
p ghc Depends libgmp-dev
p libgmp-dev Recommends libstdc++-4.8-dev | libstdc++-dev
p libstdc++-4.8-dev Depends gcc-4.8-base (= 4.8.4-1)
That is there is one package (cron) installed that only recommends one
of a list of packages none of which are actually installed. Then
there is a long list of Provides, Recommends, and Depends, all of
which are pointless since the root of all this isn't installed. At
the end of that long list is gcc-4.8-base and that makes aptitude
think it should keep that package? Strange.
(BTW, this is a router running a very minimal installation, therefore
I don't want any X11, graphical, desktop, window-manager, Haskell, C++
devel stuff on it.)
Even calling apt-get autoremove explicitly doesn't remove that
package:
# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I regularly observe things like this, not only on Raspbian, but also
on Debian stretch for amd64 which runs on my server machine.
urs
Reply to: