Bug 30279 - PackageManager: order of packages influences installation
PackageManager: order of packages influences installation
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: univention-lib
UCS 3.1
Other Linux
: P3 normal (vote)
: UCS 3.1-1
Assigned To: Dirk Wiesenthal
Florian Best
:
: 29636 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-05 11:57 CET by Alexander Kläser
Modified: 2015-05-19 15:49 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kläser univentionstaff 2013-02-05 11:57:13 CET
We just realized that the order of packages to be installed influence the final outcome. The following script cannot install the given packages:

> #!/usr/bin/python
> 
> from univention.lib.package_manager import PackageManager
> 
> def info_handler(s): print 'INFO:', s
> def error_handler(s): print 'ERROR:', s
> def step_handler(s): print 'STEP:', s
> 
> package_manager = PackageManager(info_handler=info_handler, error_handler=error_handler, step_handler=step_handler, lock=False, always_noninteractive=True)
> with package_manager.locked(reset_status=True, set_finished=True):
> with package_manager.no_umc_restart(exclude_apache=True):
> success = package_manager.install('ucs-school-slave', 'univention-samba', 'univention-samba-slave-pdc')

Its output is:

> INFO: ucs-school-slave: Failed to install
> ERROR: ucs-school-slave: Failed to install
> INFO: univention-samba: Failed to install
> ERROR: univention-samba: Failed to install
> INFO: univention-samba-slave-pdc: Failed to install
> ERROR: univention-samba-slave-pdc: Failed to install

ucs-school-slave has a dependency on univention-samba4 | univention-samba. Listing it as first packages seems to mark univention-samba4 for the installation. In turn, this conflicts with univention-samba. Setting ucs-school-slave at the end of the list resolves this issue.

Nevertheless, it would be good to adjust the behaviour to be independent of the package order.
Comment 1 Dirk Wiesenthal univentionstaff 2013-03-12 14:39:00 CET
*** Bug 29636 has been marked as a duplicate of this bug. ***
Comment 2 Dirk Wiesenthal univentionstaff 2013-03-12 14:45:35 CET
Use apt.cache.ProblemResolver manually. I was not able to be fully compatible with apt-get install, but I think I am close enough.

Fixed in:
  univention-lib 2.0.23-1.121.201303121440

package_manager.install('ucs-school-slave', 'univention-samba', 'univention-samba-slave-pdc')
should now correctly install these packages and not samba4, ordering does not matter anymore. One exception: In this specific situation, one package is installed that would not have been installed with the "correct order": python-sqlite2. I guess this is because it is to be installed during ucs-school-slave -> univention-samba4 and cannot be identified as garbage during univention-samba: There is a OR-dependency on pykota thus it is not autoremovable, although another package in the OR-dependency list is already installed. Not perfect, but fixing this would be too much effort I would say.
Comment 3 Florian Best univentionstaff 2013-03-21 10:25:39 CET
(In reply to comment #2)
> Use apt.cache.ProblemResolver manually. I was not able to be fully compatible
> with apt-get install, but I think I am close enough.
> 
> Fixed in:
>   univention-lib 2.0.23-1.121.201303121440
> 
> package_manager.install('ucs-school-slave', 'univention-samba',
> 'univention-samba-slave-pdc')
> should now correctly install these packages and not samba4, ordering does not
> matter anymore. One exception: In this specific situation, one package is
> installed that would not have been installed with the "correct order":
> python-sqlite2. I guess this is because it is to be installed during
> ucs-school-slave -> univention-samba4 and cannot be identified as garbage
> during univention-samba: There is a OR-dependency on pykota thus it is not
> autoremovable, although another package in the OR-dependency list is already
> installed. Not perfect, but fixing this would be too much effort I would say.
OK, the order of the packages does not matter anymore. The python-pysqlite2 package was not installed on my system.

(In reply to comment #1)
> *** Bug 29636 has been marked as a duplicate of this bug. ***
The uninstallation szenario from Bug 29636 was successfully.

Changelog OK
Comment 4 Stefan Gohmann univentionstaff 2013-03-25 19:56:56 CET
UCS 3.1-1 has been released: 
 http://download.univention.de/doc/release-notes-3.1-1_en.pdf
 http://download.univention.de/doc/release-notes-3.1-1.pdf

If this error occurs again, please use "Clone This Bug".