Installer removes many unrelated packages!

Bug #363750 reported by ErikVanMourik
2
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Unassigned
aptitude (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The HPLIP installer, in automatic mode, removes existing hplip and hpijs packages. As a side effect, the installer also removed lots of unrelated, but important packages. This could seriously damage the entire Linux installation !

Explanation of the error: In Ubuntu 8.04, packages hplip and hpijs are installed as dependencies under an important parent package, called 'ubuntu-desktop'. Although these dependencies don't have priority 'depends' but only 'recommends', the use of flag '--assume-yes' seems to trigger the removal of the parent package 'ubuntu-desktop'.

In a cascade-like fashion, dozens of other packages that are dependencies of the parent package are also removed. This includes packages like: Xorg, brasero, tomboy, f-spot, compiz, network-manager, tracker, mono-runtime, pulseaudio and lots of library and support packages related to these packages.

The HPLIP installer gives absolutely NO on-screen indication that all those packages are removed. I only found out what was going on when I manually checked the package install log file to see why the removal of two packages (hplip and hpijs) was taking so long...

Shocked, I immediately interrupted the HPLIP installer and have tried to reinstall all removed packages. It looks like I was quick enough, and don't have to restore a backup.

Root cause of problem: IMHO, the Ubuntu install utility reacts in an unexpected manner on the removal of two non-mandatory dependencies of an important parent package. Strictly, this is not only the responsibility of the HPLIP team, but also of the Ubuntu team. I linked this bug report to their project as well.

description: updated
Revision history for this message
ErikVanMourik (ubuntu-drietakt) wrote :

Further analysis:

- The HPLIP installer seems to invoke the Ubuntu package manager via the following command:

  aptitude remove --assume-yes hplip hpijs

- I manually tried several variations of this command, each time adding the '-s' flag (simulate) to avoid actual package removal. My initial description was not entirely correct, because even without the '--assume-yes' flag, aptitude still wants to remove the 'ubuntu-desktop' package.

- I also tried removing packages hplip and hpijs via an interactive session in aptitude, with surprising results: The removal of these packages creates a few broken dependencies. When I cycle through these dependencies, and remove the offending packages by hand, only a few packages are eventually removed. Let me rephrase that: package 'ubuntu-desktop' is NOT removed in this scenario.

- In another experiment, I used package manager apt-get instead of aptitude (again with the '-s' flag). The command I used was:

  apt-get -s remove hplip hpijs

- And another surprise: The above command removed only 3 packages: hplip, hpijs and foomatic-db-hpijs. The latter is a package that has a direct dependency on the hpijs package.

- My preliminary conclusion: The aptitude package manager is NOT the best tool to use when removing packages in a non-interactive manner. It would be advisable to use apt-get calls instead of aptitude calls in the HPLIP automatic install script.

Andreas Moog (ampelbein)
affects: ubuntu → aptitude (Ubuntu)
Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

I've changed the HPLIP installer to use apt-get to remove the packages instead of using aptitude. This will be included in the next release of HPLIP.

Aaron

Changed in hplip:
status: New → Fix Released
Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

The aptitude is wanting to remove a lot of other packages that apt-get doesn't seem to care about.

Can you run:

apt-get -s remove hplip hpijs

and

aptitude -s remove hplip hpijs

and post the output from both? Maybe someone on the aptitude team can help.

Thanks.

Aaron

Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

Also I wanted to note this doesn't happen with Jaunty 9.04. So it may already be fixed in aptitude.

A

Revision history for this message
ErikVanMourik (ubuntu-drietakt) wrote :
Download full text (3.7 KiB)

My apologies for the delayed reply. I can no longer run tests on the PC on which the problem first occurred. The printer driver update was essential, so I chose to upgrade the PC from 8.04 LTS (Hardy) to 8.10 (Intrepid). The following results are from another PC that runs 8.04 LTS.

I must make a note here: The machine where the error first occurred was running 8.04 LTS (Hardy), but it had originally been installed using Ubuntu 6.06LTS (Dapper Drake). It was later migrated to Hardy. This might possibly affect the package conflict resolution settings used by aptitude.

In the coming days, I will try to recreate the same configuration on another machine, and then repeat the tests below. If the results are any different, I will report them.

In the mean time, here are the results from the other PC.

The result from 'apt-get -s remove hplip hpijs' is:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  foomatic-db-hpijs hpijs hplip
0 upgraded, 0 newly installed, 3 to remove and 23 not upgraded.
Remv foomatic-db-hpijs [20070813-0ubuntu2]
Remv hpijs [2.8.2+2.8.2-0ubuntu8.1]
Remv hplip [2.8.2-0ubuntu8.1]

The result from 'aptitude -s remove hplip hpijs' is probably not what you were asking for. Because the flag '--assume-yes' is not given, aptitude proposes many different possible solutions, and asks the user to accept one of them. Example:

:Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages are BROKEN:
  foomatic-db-hpijs
The following packages will be REMOVED:
  hpijs hplip
0 packages upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 1888kB will be freed.
The following packages have unmet dependencies:
  foomatic-db-hpijs: Depends: hpijs (> 2) but it is not installable
Resolving dependencies...
The following actions will resolve these dependencies:

Remove the following packages:
foomatic-db-hpijs
hal-cups-utils
hplip-data
system-config-printer-common
system-config-printer-gnome
ubuntu-desktop

Score is 464

Accept this solution? [Y/n/q/?]

I have also tested the same command with the mentioned flag added, like 'aptitude -s remove --assume-yes hplip hpijs'. The result was:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages are BROKEN:
  foomatic-db-hpijs
The following packages will be REMOVED:
  hpijs hplip
0 packages upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 1888kB will be freed.
The following packages have unmet dependencies:
  foomatic-db-hpijs: Depends: hpijs (> 2) but it is not installable
Resolving dependencies...
The following actions will resolve these dependencies:

Remove the following packages:
foomatic-db-hpijs
hal-cups-utils
hplip-data
system-config-printer-common
system-...

Read more...

Revision history for this message
dinexi (im-dinexi) wrote :
Download full text (7.7 KiB)

Same things are going on here, aptitude 0.6.6-1ubuntu1:

root@home:/home/stanis# aptitude remove apache2-mpm-worker
The following packages will be REMOVED:
  apache2-mpm-worker
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 56.3 kB will be freed.
The following packages have unmet dependencies:
 libapache2-mod-wsgi : Depends: apache2 but it is not going to be installed.
Internal error: the solver Install(ghostscript:i386 9.05~dfsg-0ubuntu4 <gs-cjk-resource:amd64 1.20100103-3 -> {ghostscript:amd64 9.05~dfsg-0ubuntu4 ghostscript:i386 9.05~dfsg-0ubuntu4}>) of a supposedly unresolved dependency is already installed in step 466
Internal error: the solver Install(ghostscript:i386 9.05~dfsg-0ubuntu4 <ghostscript-x:amd64 9.05~dfsg-0ubuntu4 -> {ghostscript:amd64 9.05~dfsg-0ubuntu4 ghostscript:i386 9.05~dfsg-0ubuntu4}>) of a supposedly unresolved dependency is already installed in step 466
Internal error: the solver Install(bamfdaemon:i386 0.2.114-0ubuntu1 <libbamf3-0:amd64 0.2.114-0ubuntu1 -> {bamfdaemon:amd64 0.2.114-0ubuntu1 bamfdaemon:i386 0.2.114-0ubuntu1}>) of a supposedly unresolved dependency is already installed in step 594
Internal error: the solver Install(bamfdaemon:i386 0.2.114-0ubuntu1 <libbamf0:amd64 0.2.114-0ubuntu1 -> {bamfdaemon:amd64 0.2.114-0ubuntu1 bamfdaemon:i386 0.2.114-0ubuntu1}>) of a supposedly unresolved dependency is already installed in step 594
The following actions will resolve these dependencies:

      Remove the following packages:
1) libapache2-mod-wsgi
2) libasound2:i386
3) libasound2-plugins:i386
4) libasyncns0:i386
5) libaudio2:i386
6) libavahi-client3:i386
7) libavahi-common3:i386
8) libc6:i386
9) libcomerr2:i386
10) libcups2:i386
11) libdbus-1-3:i386
12) libdbusmenu-qt2:i386
13) libelf1:i386
14) libexpat1:i386
15) libffi6:i386
16) libflac8:i386
17) libfontconfig1:i386
18) libfreetype6:i386
19) libgcc1:i386
20) libgcrypt11:i386
21) libglib2.0-0:i386
22) libgnutls26:i386
23) libgpg-error0:i386
24)...

Read more...

Revision history for this message
Daniel Hartwig (wigs) wrote :

On 25 May 2012 19:52, dinexi <email address hidden> wrote:
>      Remove the following packages:
> 1)      libapache2-mod-wsgi
> 2)      libasound2:i386
> 3)      libasound2-plugins:i386
> 4)      libasyncns0:i386

[… unrelated foreign-arch packages …]

This specific case is related to multi-arch and reported at:

https://bugs.launchpad.net/bugs/831768

Revision history for this message
Paul White (paulw2u) wrote :

Bug 831768 was closed 2013-04-26 so marking
this one "Fix Released" too.

Changed in aptitude (Ubuntu):
status: New → 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.