apt wants to autoremove packages i explicitly installed

Bug #86921 reported by Martin Pool
2
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Michael Vogt

Bug Description

On my feisty machines I regularly get

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  f-spot libgnomecupsui1.0-1c2a libwpd8c2a libxmlsec1 wamerican evolution-webcal ekiga openoffice.org-gnome gimp-print ttf-devanagari-fonts libjaxp1.2-java pnm2ppa linux-headers-2.6.20-6 gthumb openoffice.org-core gnome-nettool
  libgphoto2-port0 openoffice.org-style-default libneon26 cdparanoia openoffice.org-impress ubuntu-docs ttf-punjabi-fonts wvdial xsane ttf-indic-fonts intltool-debian libdjvulibre15 libwmf0.2-7 tangerine-icon-theme libicu36
  openoffice.org-draw libstlport5.1 ttf-thai-tlwg ttf-kochi-mincho libxmlsec1-openssl doc-base brltty-x11 avahi-daemon vnc-common ttf-mgopen openoffice.org-java-common openoffice.org-gtk libwvstreams4.2-base libsane esound
  ttf-kannada-fonts ttf-gentium rhythmbox bluez-cups readahead libieee1284-3 libstlport4.6c2 openoffice.org-style-industrial screen bc acpi dc libxmlsec1-nss po-debconf python-virtkey gnome2-user-guide whois scim-modules-socket
  powernowd openoffice.org-l10n-common scim libgpod0 libgpod1 libscim8c2a ttf-lao usplash-theme-ubuntu libgphoto2-2 libmdbtools ttf-kochi-gothic libnss-mdns tango-icon-theme-common libpoppler1-glib tango-icon-theme foomatic-db-hpijs
  scim-gtk2-immodule libgutenprintui2-1 bluez-utils gettext diveintopython libmusicbrainz4c2a ttf-gujarati-fonts xvncviewer bsh gnome-volume-manager openoffice.org-evolution libkpathsea4 openoffice.org-math screensaver-default-images
  openoffice.org-common ttf-telugu-fonts libjaxp1.3-java gnome-spell bug-buddy ttf-tamil-fonts libgutenprint2 ttf-opensymbol avahi-autoipd vino libjline-java gnome-keyring-manager cupsys-driver-gutenprint libxerces2-java
  libmono-sqlite2.0-cil evince ttf-arphic-uming ttf-malayalam-fonts openoffice.org-thesaurus-en-us landscape-client contact-lookup-applet libxalan2-java linux-headers-2.6.20-6-generic xcursor-themes gimp foo2zjs xsane-common
  ttf-arphic-ukai libgimp2.0 libwvstreams4.2-extras libdaemon0 libxplc0.3.13 ttf-oriya-fonts liboobs-1-2 libgucharmap5 onboard ttf-baekmuk libmyspell3c2 openoffice.org-l10n-en-gb libhsqldb-java libopal-2.2.0 gconf-editor
  gnome-system-tools ttf-arabeyes libuniconf4.2 libservlet2.3-java openoffice.org-base openoffice.org-l10n-en-za wbritish hotkey-setup mozilla-firefox-locale-en-gb openoffice.org-calc ttf-bengali-fonts gimp-data gnome-mount min12xxw
  libavahi-core4 libavahi-core5 freeglut3 libsndfile1 make bluez-pin example-content gimp-python serpentine gnome-cups-manager ssh-askpass-gnome sound-juicer lftp
Use 'apt-get autoremove' to remove them.

I don't know about the library, but some of these (like lftp) I specifically asked for, and some of the others (gimp and make) seem like very strange things to autoremove.

I have not been brave enough to run it and see what happens...

Michael Vogt (mvo)
Changed in apt:
assignee: nobody → mvo
importance: Undecided → High
status: Unconfirmed → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

I've just reinstalled and have a similar situation. Basically I just came up from alternate and installed ubuntu-desktop

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :
Download full text (4.0 KiB)

Same on edgy here.

Situation:

(1) Installed Ubuntu edgy.

(2) Installed kubuntu-desktop (3.5.6 from kubuntu.org).

(3) Installed OpenOffice 2.1 vanilla (which removed ubuntu-desktop meta package)

(4) Uninstalled kubuntu-desktop meta package (which survived OpenOffice-2.1-Install but can't be reinstalled without OpenOffice from edgy)

(5) Try to prevent apt from autoremoving kde-stuff:
sudo apt-get install kde-core
sudo apt-get --reinstall install acpi acpi-support acpid adept akregator amarok anacron ark arts avahi-daemon bc bogofilter cdparanoia cdrdao cdrecord cupsys cupsys-bsd cupsys-client cupsys-driver-gutenprint dbus dc digikam diveintopython doc-base dvd+rw-tools foo2zjs foomatic-db foomatic-db-engine foomatic-db-hpijs foomatic-filters fortune-mod gdb gs-esp gtk2-engines-gtk-qt gwenview hal hotkey-setup wdb-client-kde k3b kaddressbook kaffeine-xine kamera karm katapult kate kaudiocreator kcontrol kcron kde-guidance kde-guidance-powermanager kde-systemsettings kdeadmin-kfile-plugins kdebase-kio-plugins kdebluetooth kdegraphics-kfile-plugins kdemultimedia-kfile-plugins kdemultimedia-kio-plugins kdenetwork-filesharing kdenetwork-kfile-plugins kdepasswd kdepim-kio-plugins kdepim-wizards kdeprint kdesktop kdm kdnssd keep kfind kghostview khelpcenter kicker kio-apt kio-locate kipi-plugins klipper kmail kmailcvt kmenuedit kmilo kmix kmplayer-konq-plugins knetworkconf knotes konq-plugins konqueror konqueror-nsplugins konsole kontact konversation kooka kopete korganizer kpdf kpf kppp krdc krfb krita kscd ksmserver ksnapshot ksplash ksplash-engine-moodin ksvg ksysguard ksystemlog ktorrent kubuntu-artwork-usplash kubuntu-default-settings kubuntu-docs kubuntu-konqueror-shortcuts kwalletmanager kwin landscape-client language-selector-qt lftp libarts1-akode libgl1-mesa-glx libglut3 libnss-mdns libpam-foreground libsasl2-modules libstdc++5 libxp6 min12xxw mkisofs pmount pnm2ppa powermanagement-interface qca-tls readahead screen slocate smbclient speedcrunch ttf-bitstream-vera ttf-dejavu ttf-freefont unzip usplash vorbis-tools wlassistant wvdial x-ttcidfont-conf xkeyboard-config xorg xterm zip
(all Dependencies from kubuntu-desktop beside apmd)

(6) It didn't help:
LANG=C sudo apt-get --dry-run autoremove
...
The following packages will be REMOVED:
adept adept-batch adept-common adept-installer dept-manager adept-notifier adept-updater akregator apt-index-watcher ark bogofilter bogofilter-bdb bogofilter-common debtags digikam gimp-help-common gimp-help-de gstreamer0.10-gnonlin gwenview hwdb-client-kde k3b kaffeine kaffeine-xine karm katapult kaudiocreator kbstate kcron kde-guidance kde-guidance-powermanager kde-icons-mono kde-systemsettings kdeadmin-kfile-plugins kdebluetooth kdegraphics-kfile-plugins kdemultimedia-kfile-plugins kdenetwork-filesharing kdenetwork-kfile-plugins kdepim-kio-plugins kdepim-kresources kdepim-wizards kdnssd keep kio-apt kio-locate kipi-plugins kmag kmail kmailcvt kmilo kmix kmousetool kmplayer-base kmplayer-konq-plugins knetworkconf knotes koffice-data koffice-libs konq-plugins kontact konversation kooka kopete korganizer kpdf kpf kppp krdc krfb krita krita-data kscd ksnapshot ksplash-engine-moodin ksvg ksystemlog ktorre...

Read more...

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

Sorry for the long post, but as you can see at the end it would even remove OpenOffice, which I installed manually as mentioned.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

I prepared a new apt upload that will explicitly exclude all direct dependencies from meta-packages from being marked as automatic installs. This should fix a lot of the confusion seen here.

In addition to this I have attached a fixup script that will mark the current direct dependencies of installed meta-packages as manual installed. It will make a copy of your old state file in /var/lib/apt/extended_states.fixup-save so if anything goes wrong, you can still copy it back.

The script requires the latest python-apt to work.

Please test it and let me know if that fixes the issues at hand.

Thanks,
 Michael

Changed in apt:
status: Confirmed → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

This shell fragment should do the same job:

DEPS=""; for pkg in ubuntu-desktop kubuntu-desktop edubuntu-desktop xubuntu-desktop edubuntu-server ubuntu-minimal ubuntu-standard; do if dpkg -s $pkg >/dev/null 2>&1 ; then for dep in $(apt-cache depends $pkg --installed | awk '{print $2}'); do if [ ! -z $dep ]; then DEPS="$DEPS $dep"; fi; done; fi; done; apt-get install $DEPS

(also less elegant)

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

I'm sorry, but I dont know how to build python-apt 0.6.20ubuntu13 on feisty (upgraded meanwhile)
apt-get source does not work (seems to be not in the list file)
Did manual download of dsc and tgz, but it insists on 0.6.20ubuntu12
(and dpkg -b finds no DEBIAN/config)

I tried shell script to, replacing apt-get install by echo
Unfortunately result was not what would be expected :-(
echo $DEPS
ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: ab: apport-gtk bluez-cups bluez-pin bluez-utils ...

Revision history for this message
Michael Vogt (mvo) wrote :

@Kurt: Thanks for testing the shell code. It works for me, but the python-apt code should be much more stable. So just wait a bit until the new python-apt hits the archive.

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

@Michael: OK, thank you for that work.

Upgraded feisty now and tested fixup.py and apt-get:

(1)
Uninstalled ubuntu-desktop and kubuntu-desktop (to get situation similar to edgy with OpenOffice 2.1)
Run fixup.py
Checked autoremove
Nothing did change (see below)

(2)
Installed ubuntu-desktop and kubuntu-desktop
Run fixup.py
Uninstalled ubuntu-desktop and kubuntu-desktop
Checked autoremove
Seems OK now :)

(3)
Reinstalled some other packages that apt-get wants to autoremove even when ubuntu-desktop and kubuntu-desktop are installed
Checked autoremove
Seems OK now too :)

Some Ideas about this:
Maybe posibility to give explicite [meta-]packages to fixup.py would be good in situation (1) ?
Otherwise someone may need to break his installation by installing gone meta-packages or do a reinstall on all depending packages manually which is not really easy to do.
Additionaly fixup.py could maybe give some warning in case no desktop meta package is installed ?

Revision history for this message
Michael Vogt (mvo) wrote :

Apt is fixed in feisty to take the meta packages into account.

The release upgrader will take care of making sure that script I posed here is run during the upgrade to fix existing install.

Cheers,
 Michael

Changed in apt:
status: In Progress → Fix Committed
Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

Thank you very much :)

Michael Vogt (mvo)
Changed in apt:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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