Installer removes many unrelated packages!
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.
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.