aptitude does not automatically remove unused packages

Bug #305504 reported by hdante on 2008-12-05
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
aptitude (Debian)
Fix Released
Unknown
aptitude (Ubuntu)
Undecided
Unassigned

Bug Description

In Ubuntu 8.10, if I use aptitude to install "epiphany-webkit", then use aptitude to remove "epiphany-webkit", its dependency packages, like epiphany-browser-data and libwebkit, are not automatically removed.

Steps to reproduce
1. sudo aptitude
2. select epiphany-webkit
3. install
4. sudo aptitude
5. deselect epiphany-webkit
6. deselect epiphany-browser
7. error: dependency packages are not automatically removed

Automatic dependency handling is the sole reason anyone would use aptitude in Ubuntu.

hdante (hdante) wrote :

Same bug in gcc-3.4. Install gcc-3.4, remove it and dependencies are not removed.

Daniel Queirolo (danf-1979) wrote :

hdante, thanks for contributing. I can confirm this bug in Jaunty.

~$ apt-cache policy aptitude
aptitude:
  Installed: 0.4.11.10-1lenny1.1ubuntu1
  Candidate: 0.4.11.10-1lenny1.1ubuntu1
  Version table:
 *** 0.4.11.10-1lenny1.1ubuntu1 0
        500 http://archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

Steps to reproduce:

1) $ sudo aptitude install gcc-3.4
results in:
The following NEW packages will be installed:
  cpp-3.4{a} gcc-3.4 gcc-3.4-base{a}

2) $ sudo aptitude purge gcc-3.4
results in:
The following packages will be REMOVED:
  gcc-3.4{p}

3) apt-get autoremove
results in:
The following packages were automatically installed and are no longer required:
  gcc-3.4-base cpp-3.4

Changed in aptitude:
status: New → Confirmed
Onno Benschop (onno-itmaze) wrote :

With libvirt-bin it automatically installs netcat-openbsd dnsmasq-base, but when I run aptitude purge, it leaves netcat-openbsd behind.

For me, auto-removal of dependencies works with your examples (epiphany-webkit and gcc-?.??). However, I experience the problem you describe with the *buntu-desktop meta-packages. Is there something special about the dependencies of these packages?

Steps to reproduce:

1) sudo aptitude install ubuntu-desktop
2) sudo aptitude remove ubuntu-desktop

Only the meta-package itself is removed, not its dependencies.
The same happens with meta-package xubuntu-desktop or lubuntu-desktop.
That's strange, since installing (and uninstalling) the *buntu-desktop-packages is one of aptitude's use-cases that is explicitely mentioned on several sites.

Philip Muškovac (yofel) wrote :

@Rüdiger: That is intentional and is set in /etc/apt/apt.conf.d/01autoremove which belongs to apt.

[...]
  Never-MarkAuto-Sections
  {
        "metapackages";
        "restricted/metapackages";
        "universe/metapackages";
        "multiverse/metapackages";
        "oldlibs";
        "restricted/oldlibs";
        "universe/oldlibs";
        "multiverse/oldlibs";

  };

Thanks, Phlip! That clears things up. But why is this information so hard to find? Shouldn't the manpage of aptitude or apt-get mention that meta-packages are handled differently? You wouldn't expect this.

Changed in aptitude (Debian):
status: Unknown → New
Changed in aptitude (Debian):
status: New → Confirmed
Thierry Machet (thierry-machet) wrote :

Dear all,

I observed the same problem. Another example with some digging:

sudo aptitude install awesome
  Les NOUVEAUX paquets suivants vont être installés :
   awesome feh{a} giblib1{a} libev4{a} libid3tag0{a} libimlib2{a}
   libjpeg-progs{a} libjpeg-turbo-progs{a} libxcb-icccm4{a} libxcb-image0{a}
   libxcb-keysyms1{a} libxcb-randr0{a} libxcb-xinerama0{a} libxcb-xtest0{a}
   libxdg-basedir1{a} menu{a} rlwrap{a}
   0 paquets mis à jour, 17 nouvellement installés, 0 à enlever et 11 non mis à jour.

sudo aptitude remove awesome
        Les paquets suivants seront ENLEVÉS :
       awesome
       0 paquets mis à jour, 0 nouvellement installés, 1 à enlever et 11 non mis à jour.

It looks like the packages are not marked Auto:
            aptitude show giblib1
                Paquet : giblib1
                État: installé
               Automatiquement installé: non

But marking as auto does not solve:
        sudo aptitude markauto feh giblib1 libev4 libid3tag0 libimlib2 libjpeg-progs libjpeg-turbo-progs libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-xinerama0 libxcb-xtest0 libxdg-basedir1 menu rlwrap</command></para>

 aptitude show giblib1
            Paquet : giblib1
           État: installé
           Automatiquement installé: oui

         sudo aptitude remove awesome -s
         Les paquets suivants seront ENLEVÉS :
                     awesome
                     0 paquets mis à jour, 0 nouvellement installés, 1 à enlever et 11 non mis à jour.

        And apt-get is not working better even if packages are marked auto:
        sudo apt-get autoremove awesome -s
       Les paquets suivants seront ENLEVÉS :
                    awesome
                    0 mis à jour, 0 nouvellement installés, 1 à enlever et 11 non mis à jour

Only way remove manually
        sudo aptitude remove awesome feh giblib1 libev4 libid3tag0 libimlib2 libjpeg-progs libjpeg-turbo-progs libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-xinerama0 libxcb-xtest0 libxdg-basedir1 menu rlwrap

Versions:
         Ubuntu 13.04
         aptitude version 0.6.8.1

Regards

Changed in aptitude (Debian):
status: Confirmed → Fix Committed
Changed in aptitude (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.