Bug 51690 - Force UCS-5.0-0 package installation
Force UCS-5.0-0 package installation
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - Release updates
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Philipp Hahn
Sönke Schwardt-Krummrich
:
Depends on: 51865
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-20 17:07 CEST by Philipp Hahn
Modified: 2021-05-25 16:02 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
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:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2020-07-20 17:07:02 CEST
For UCS-5 we decided to change the package repository structure (Bug #51588) and to no longer re-build packages: Since UCS-4.2 (Bug #41608) we mostly import binary packages from Debian directly without rebuilding them from source. Before that we only imported the source packages are re-build everything ourselves.
Also since UCS-4.2 we switched the UCS build stamp (Bug #37376) to improve the following issue: Before UCS-4.2 the UCS build stamp was separated by the "." character, which compares *last* to all other separators used in Debian like "+deb10u0" or ".1" for NMUs or "+b1" for BINNMUs.
Debian-10-Buster still carries many packages unmodified from Debian-9-Stretch or even older, as no new upstream version was released for years or no changes were done by the Debian maintainer. Some of those packages were rebuild by us and so still carry our UCS build stamp, so version from previous UCS releases still compare later to the version from Debian-10-Buster.

On an upgrade from UCS-4.4 to UCS-5.0 those packages would remain installed as the version from UCS-4.4 compares latest. Mostly this is not problematic, but is critical for some packages, for example PERL related packages: Each new PERL release requires a rebuild of many other PERL packages as they contain the ABI version and do not work with previous/later versions. This is done by Debian though the BINNMU mechanism, which is broken due to our rebuilds.

As we want to stop re-compiling those packages we have to switch to the Debian-10-Buster packages once even if they sort earlier.

This can be done by providing a preferences file, which assigned priority>=1000 to the packages from Debian-10-Buster once during the upgrade to UCS-5.0-0:

$ grep ^deb /etc/apt/sources.list
deb [trusted=yes] http://omar.knut.univention.de/build2/ ucs_5.0-0/all/
deb [trusted=yes] http://omar.knut.univention.de/build2/ ucs_5.0-0/$(ARCH)/

$ cat /etc/apt/preferences
Package: *
Pin: release l=Univention Corporate Server, v=5.0.0
Pin-Priority: 1001

I have successfully testes this and it seems to work without problems so far.
Comment 1 Philipp Hahn univentionstaff 2020-09-14 11:09:48 CEST
Implemented as part of the work on Bug #51588

TODO: Test this when the work on the upgrade path from UCS-4 to UCS-5
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2021-02-19 17:07:08 CET
I noticed 2 smaller problems:

Die folgenden Pakete werden durch eine ÄLTERE VERSION ERSETZT (Downgrade):
  docker-compose eject ifplugd libfsplib0 libnetpbm10 libtext-charwidth-perl
  libtext-wrapi18n-perl libtre5 mawk netpbm python-pam python-singledispatch
791 aktualisiert, 252 neu installiert, 12 durch eine ältere Version ersetzt, 10 zu entfernen und 0 nicht aktualisiert.
E: Packages were downgraded and -y was used without --allow-downgrades.
Error: Failed to execute "apt-get -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-overwrite -o DPkg::Options::=--force-overwrite-dir --trivial-only=no --assume-yes --quiet=1 -u dist-upgrade"
exitcode of univention-updater: 1
ERROR: update failed. Please check /var/log/univention/updater.log

This can be fixed via
ucr set \
  update/commands/distupgrade='apt-get -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-overwrite -o DPkg::Options::=--force-overwrite-dir --trivial-only=no --assume-yes --quiet=1 --allow-downgrades -u dist-upgrade' \
  update/commands/distupgrade/simulate='apt-get -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-overwrite -o DPkg::Options::=--force-overwrite-dir --trivial-only=no --assume-yes --quiet=1 --allow-downgrades -us dist-upgrade' 


(In reply to Philipp Hahn from comment #0)
> $ cat /etc/apt/preferences
> Package: *
> Pin: release l=Univention Corporate Server, v=5.0.0
> Pin-Priority: 1001

This should have been "v=5.0-0" and not "v=5.0.0".
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2021-02-19 17:14:00 CET
(In reply to Sönke Schwardt-Krummrich from comment #2)
> This can be fixed via
> ucr set \
>   update/commands/distupgrade='apt-get -o DPkg::Options::=--force-confold -o
> DPkg::Options::=--force-overwrite -o DPkg::Options::=--force-overwrite-dir
> --trivial-only=no --assume-yes --quiet=1 --allow-downgrades -u dist-upgrade'
> \
>   update/commands/distupgrade/simulate='apt-get -o
> DPkg::Options::=--force-confold -o DPkg::Options::=--force-overwrite -o
> DPkg::Options::=--force-overwrite-dir --trivial-only=no --assume-yes
> --quiet=1 --allow-downgrades -us dist-upgrade' 

AFAICS we have to set these variables via an erratum/prior to the execution of univention-upgrade. Altering these variables during preup.sh is not sufficient/too late.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2021-02-19 17:49:35 CET
For completeness: 
the following packages use a smaller package version within UCS 5.0-0 release:

PKG: cloud-initramfs-growroot
   4.0-0: 0.25ubuntu1.3.201410231540
   5.0-0: 0.18.debian7
   Src pkg: cloud-initramfs-tools

PKG: daemon
   4.3-0: 0.6.4-1.A~4.3.0.201712102313
   5.0-0: 0.6.4-1+b2
   Src pkg: daemon (0.6.4-1)

PKG: devio
   4.3-0: 1.2-1.A~4.3.0.201711291434
   5.0-0: 1.2-1.2+b1
   Src pkg: devio (1.2-1.2)

PKG: docker-compose
   4.4-2: 1.24.1-1A~4.4.0.201909101001
   5.0-0: 1.21.0-3
   Src pkg: docker-compose

PKG: dvidvi
   4.3-0: 1.0-8.A~4.3.0.201711291434
   5.0-0: 1.0-8.2+b1
   Src pkg: dvidvi (1.0-8.2)

PKG: eject
   4.3-0: 2.1.5+deb1+cvs20081104-13.A~4.3.0.201711291434
   5.0-0: 2.1.5+deb1+cvs20081104-13.2
   Src pkg: eject

PKG: fam
   4.3-0: 2.7.0-17.A~4.3.0.201711291434
   5.0-0: 2.7.0-17.3
   Src pkg: fam

PKG: fxload
   4.3-0: 0.0.20081013-1.A~4.3.0.201712102313
   5.0-0: 0.0.20081013-1+b2
   Src pkg: fxload (0.0.20081013-1)

PKG: grub-efi-amd64-signed
   4.4-2: 3.0.0-1-2.02~beta3-5+deb9u2A~4.4A~4.4.0.201910111621
   5.0-0: 1+2.02+dfsg1+20+deb10u3
   Src pkg: grub-efi-amd64-signed

PKG: ifplugd
   4.3-0: 0.28-19.A~4.3.0.201711291434
   5.0-0: 0.28-19.4
   Src pkg: ifplugd

PKG: libbrowser-open-perl
   4.0-0: 0.04-1.2.201403111557
   5.0-0: 0.04-1
   Src pkg: libbrowser-open-perl

PKG: libbs2b-dev
   4.3-0: 3.1.0+dfsg-2.A~4.3.0.201711291434
   5.0-0: 3.1.0+dfsg-2.2
   Src pkg: libbs2b

PKG: libbs2b0
   4.3-0: 3.1.0+dfsg-2.A~4.3.0.201711291434
   5.0-0: 3.1.0+dfsg-2.2
   Src pkg: libbs2b

PKG: libclutter-imcontext-0.1-0
   4.0-0: 0.1.4-3.6.201403180815
   5.0-0: 0.1.4-3+b3
   Src pkg: clutter-imcontext (0.1.4-3)

PKG: libdatetime-format-oracle-perl
   4.0-0: 0.06-1.2.201403130903
   5.0-0: 0.06-1
   Src pkg: libdatetime-format-oracle-perl

PKG: libencode-eucjpms-perl
   4.3-0: 0.07-3.A~4.3.0.201712102313
   5.0-0: 0.07-3+b7
   Src pkg: libencode-eucjpms-perl (0.07-3)

PKG: libfam-dev
   4.3-0: 2.7.0-17.A~4.3.0.201711291434
   5.0-0: 2.7.0-17.3
   Src pkg: fam

PKG: libfam0
   4.3-0: 2.7.0-17.A~4.3.0.201711291434
   5.0-0: 2.7.0-17.3
   Src pkg: fam

PKG: libfam0c102
   4.3-0: 2.7.0-17.A~4.3.0.201711291434
   5.0-0: 2.7.0-17.3
   Src pkg: fam

PKG: libfile-listing-perl
   4.0-0: 6.04-1.2.201403191333
   5.0-0: 6.04-1
   Src pkg: libfile-listing-perl

PKG: libfsplib0
   4.0-0: 0.11-2.9.201403112249
   5.0-0: 0.11-2
   Src pkg: fsplib

PKG: libgssglue1
   4.0-0: 0.4-2.8.201403201245
   5.0-0: 0.4-2+b2
   Src pkg: libgssglue (0.4-2)

PKG: libgtkspell0
   4.0-0: 2.0.16-1.10.201403170008
   5.0-0: 2.0.16-1.2
   Src pkg: gtkspell

PKG: libhtml-form-perl
   4.0-0: 6.03-1.2.201403202159
   5.0-0: 6.03-1
   Src pkg: libhtml-form-perl

PKG: libhttp-date-perl
   4.0-0: 6.02-1.2.201403210357
   5.0-0: 6.02-1
   Src pkg: libhttp-date-perl

PKG: libident
   4.3-0: 0.22-3.A~4.3.0.201711291434
   5.0-0: 0.22-3.1
   Src pkg: libident

PKG: libident-dev
   4.3-0: 0.22-3.A~4.3.0.201711291434
   5.0-0: 0.22-3.1
   Src pkg: libident

PKG: libio-dirent-perl
   4.3-0: 0.05-1.A~4.3.0.201712102313
   5.0-0: 0.05-1+b7
   Src pkg: libio-dirent-perl (0.05-1)

PKG: libio-pty-perl
   4.3-0: 1:1.08-1.A~4.3.0.201711291434
   5.0-0: 1:1.08-1.1+b5
   Src pkg: libio-pty-perl (1:1.08-1.1)

PKG: libjs-prototype
   4.0-0: 1.7.1-3.14.201411031408
   5.0-0: 1.7.1-3
   Src pkg: prototypejs

PKG: libjs-scriptaculous
   4.0-0: 1.9.0-2.12.201403190044
   5.0-0: 1.9.0-2
   Src pkg: scriptaculous

PKG: liblwp-mediatypes-perl
   4.0-0: 6.02-1.2.201403222258
   5.0-0: 6.02-1
   Src pkg: liblwp-mediatypes-perl

PKG: libmimic-dev
   4.2-0: 1.0.4-2.A~4.2.0.201608231644
   5.0-0: 1.0.4-2.3+b11
   Src pkg: libmimic (1.0.4-2.3)

PKG: libmimic-doc
   4.2-0: 1.0.4-2.A~4.2.0.201608231644
   5.0-0: 1.0.4-2.3
   Src pkg: libmimic

PKG: libmimic0
   4.2-0: 1.0.4-2.A~4.2.0.201608231644
   5.0-0: 1.0.4-2.3+b11
   Src pkg: libmimic (1.0.4-2.3)

PKG: libmodule-refresh-perl
   4.0-0: 0.17-1.5.201403231522
   5.0-0: 0.17-1
   Src pkg: libmodule-refresh-perl

PKG: libnetpbm10
   4.3-0: 2:10.0-15.A~4.3.0.201711291434
   5.0-0: 2:10.0-15.3+b2
   Src pkg: netpbm-free (2:10.0-15.3)

PKG: libnetpbm10-dev
   4.3-0: 2:10.0-15.A~4.3.0.201711291434
   5.0-0: 2:10.0-15.3+b2
   Src pkg: netpbm-free (2:10.0-15.3)

PKG: libnetpbm9
   4.3-0: 2:10.0-15.A~4.3.0.201711291434
   5.0-0: 2:10.0-15.3+b2
   Src pkg: netpbm-free (2:10.0-15.3)

PKG: libnetpbm9-dev
   4.3-0: 2:10.0-15.A~4.3.0.201711291434
   5.0-0: 2:10.0-15.3+b2
   Src pkg: netpbm-free (2:10.0-15.3)

PKG: libnumber-compare-perl
   4.0-0: 0.03-1.7.201403241934
   5.0-0: 0.03-1
   Src pkg: libnumber-compare-perl

PKG: libopencore-amrnb-dev
   4.3-0: 0.1.3-2.A~4.3.0.201712102313
   5.0-0: 0.1.3-2.1+b2
   Src pkg: opencore-amr (0.1.3-2.1)

PKG: libopencore-amrnb0
   4.3-0: 0.1.3-2.A~4.3.0.201712102313
   5.0-0: 0.1.3-2.1+b2
   Src pkg: opencore-amr (0.1.3-2.1)

PKG: libopencore-amrnb0-dbg
   4.3-0: 0.1.3-2.A~4.3.0.201712102313
   5.0-0: 0.1.3-2.1+b2
   Src pkg: opencore-amr (0.1.3-2.1)

PKG: libopencore-amrwb-dev
   4.3-0: 0.1.3-2.A~4.3.0.201712102313
   5.0-0: 0.1.3-2.1+b2
   Src pkg: opencore-amr (0.1.3-2.1)

PKG: libopencore-amrwb0
   4.3-0: 0.1.3-2.A~4.3.0.201712102313
   5.0-0: 0.1.3-2.1+b2
   Src pkg: opencore-amr (0.1.3-2.1)

PKG: libopencore-amrwb0-dbg
   4.3-0: 0.1.3-2.A~4.3.0.201712102313
   5.0-0: 0.1.3-2.1+b2
   Src pkg: opencore-amr (0.1.3-2.1)

PKG: libossp-uuid-dev
   4.3-0: 1.6.2-1.A~4.3.0.201712102313
   5.0-0: 1.6.2-1.5+b7
   Src pkg: ossp-uuid (1.6.2-1.5)

PKG: libossp-uuid-perl
   4.3-0: 1.6.2-1.A~4.3.0.201712102313
   5.0-0: 1.6.2-1.5+b7
   Src pkg: ossp-uuid (1.6.2-1.5)

PKG: libossp-uuid16
   4.3-0: 1.6.2-1.A~4.3.0.201712102313
   5.0-0: 1.6.2-1.5+b7
   Src pkg: ossp-uuid (1.6.2-1.5)

PKG: libresample1
   None: 0.1.3-4.4.201403262307
   5.0-0: 0.1.3-4
   Src pkg: libresample

PKG: libresample1-dev
   None: 0.1.3-4.4.201403262307
   5.0-0: 0.1.3-4
   Src pkg: libresample

PKG: libtag-extras-dev
   4.3-0: 1.0.1-3.A~4.3.0.201711291434
   5.0-0: 1.0.1-3.1
   Src pkg: taglib-extras

PKG: libtag-extras1
   4.3-0: 1.0.1-3.A~4.3.0.201711291434
   5.0-0: 1.0.1-3.1
   Src pkg: taglib-extras

PKG: libtext-charwidth-perl
   4.3-0: 0.04-7.A~4.3.0.201712102313
   5.0-0: 0.04-7.1+b1
   Src pkg: libtext-charwidth-perl (0.04-7.1)

PKG: libtext-wrapi18n-perl
   4.3-0: 0.06-7.A~4.3.0.201711291434
   5.0-0: 0.06-7.1
   Src pkg: libtext-wrapi18n-perl

PKG: libtre-dev
   4.3-0: 0.8.0-6A~4.3.0.201711231333
   5.0-0: 0.8.0-6
   Src pkg: tre

PKG: libtre5
   4.3-0: 0.8.0-6A~4.3.0.201711231333
   5.0-0: 0.8.0-6
   Src pkg: tre

PKG: libxml-regexp-perl
   4.0-0: 0.04-1.9.201403121733
   5.0-0: 0.04-1
   Src pkg: libxml-regexp-perl

PKG: libxmlrpc-epi-dev
   4.3-0: 0.54.2-1.A~4.3.0.201711291434
   5.0-0: 0.54.2-1.2
   Src pkg: xmlrpc-epi

PKG: libxmlrpc-epi0
   4.3-0: 0.54.2-1.A~4.3.0.201711291434
   5.0-0: 0.54.2-1.2
   Src pkg: xmlrpc-epi

PKG: libxmlrpc-epi0-dbg
   4.3-0: 0.54.2-1.A~4.3.0.201711291434
   5.0-0: 0.54.2-1.2
   Src pkg: xmlrpc-epi

PKG: libxosd-dev
   4.3-0: 2.2.14-2.A~4.3.0.201712102313
   5.0-0: 2.2.14-2.1+b1
   Src pkg: xosd (2.2.14-2.1)

PKG: libxosd2
   4.3-0: 2.2.14-2.A~4.3.0.201712102313
   5.0-0: 2.2.14-2.1+b1
   Src pkg: xosd (2.2.14-2.1)

PKG: mawk
   4.3-0: 1.3.3-17.A~4.3.0.201712102313
   5.0-0: 1.3.3-17+b3
   Src pkg: mawk (1.3.3-17)

PKG: mingetty
   4.3-0: 1.08-2.A~4.3.0.201712102313
   5.0-0: 1.08-2+b1
   Src pkg: mingetty (1.08-2)

PKG: netpbm
   4.3-0: 2:10.0-15.A~4.3.0.201711291434
   5.0-0: 2:10.0-15.3+b2
   Src pkg: netpbm-free (2:10.0-15.3)

PKG: oxygencursors
   4.0-0: 0.0.2012-06-kde4.8-2.1.7.201403241259
   5.0-0: 0.0.2012-06-kde4.8-2.1
   Src pkg: oxygencursors

PKG: python-jaxml
   4.3-0: 3.01-6.A~4.3.0.201711291434
   5.0-0: 3.01-6.2
   Src pkg: jaxml

PKG: python-ldaptor
   4.0-0: 0.0.43+debian1-7.15.201403241524
   5.0-0: 0.0.43+debian1-7
   Src pkg: ldaptor

PKG: python-libmimic
   4.2-0: 1.0.4-2.A~4.2.0.201608231644
   5.0-0: 1.0.4-2.3+b11
   Src pkg: libmimic (1.0.4-2.3)

PKG: python-pam
   4.3-0: 0.4.2-13.A~4.3.0.201711291434
   5.0-0: 0.4.2-13.2ubuntu2A~5.0.0.202006081810
   Src pkg: python-pam

PKG: python-pam-dbgsym
   4.3-0: 0.4.2-13.A~4.3.0.201711291434
   5.0-0: 0.4.2-13.2ubuntu2A~5.0.0.202006081810
   Src pkg: python-pam

PKG: python-pychart
   4.3-0: 1.39-7.A~4.3.0.201711291434
   5.0-0: 1.39-7.1
   Src pkg: python-pychart

PKG: python-pychart-doc
   4.3-0: 1.39-7.A~4.3.0.201711291434
   5.0-0: 1.39-7.1
   Src pkg: python-pychart

PKG: python-singledispatch
   4.4-0: 3.4.0.3-2A~4.4.0.201901161356
   5.0-0: 3.4.0.3-2
   Src pkg: singledispatch

PKG: python-webhelpers
   4.0-0: 1.3-4.5.201403131651
   5.0-0: 1.3-4
   Src pkg: webhelpers

PKG: python3-singledispatch
   4.4-0: 3.4.0.3-2A~4.4.0.201901161356
   5.0-0: 3.4.0.3-2
   Src pkg: singledispatch

PKG: shim-signed
   4.3-0: 2.0.0-1-0.7-5A~4.3.0.201802201624
   5.0-0: 1.33+15+1533136590.3beb971-7
   Src pkg: shim-signed (1.33)

PKG: tre-agrep
   4.3-0: 0.8.0-6A~4.3.0.201711231333
   5.0-0: 0.8.0-6
   Src pkg: tre

PKG: uuid
   4.3-0: 1.6.2-1.A~4.3.0.201712102313
   5.0-0: 1.6.2-1.5+b7
   Src pkg: ossp-uuid (1.6.2-1.5)

PKG: varmon
   4.3-0: 1.2.1-1.A~4.3.0.201712102313
   5.0-0: 1.2.1-1+b3
   Src pkg: varmon (1.2.1-1)

PKG: xfonts-scalable
   4.3-0: 1:1.0.3-1.A~4.3.0.201711291434
   5.0-0: 1:1.0.3-1.1
   Src pkg: xfonts-scalable

PKG: xosd-bin
   4.3-0: 2.2.14-2.A~4.3.0.201712102313
   5.0-0: 2.2.14-2.1+b1
   Src pkg: xosd (2.2.14-2.1)
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2021-02-19 17:50:29 CET
If the two problems are fixed, the downgrade works as expected.
Comment 6 Philipp Hahn univentionstaff 2021-02-19 18:31:19 CET
(In reply to Sönke Schwardt-Krummrich from comment #2)
> I noticed 2 smaller problems:
...
> (In reply to Philipp Hahn from comment #0)
> > $ cat /etc/apt/preferences
> > Package: *
> > Pin: release l=Univention Corporate Server, v=5.0.0
> > Pin-Priority: 1001
> 
> This should have been "v=5.0-0" and not "v=5.0.0".

No, "5.0.0" is correct / wanted. Actually it's a bug in `repop-ng`:

$ grep ^Version mirror/ftp/4.4/maintained/4.4-7/dists/ucs4??/Release mirror/ftp/4.4/maintained/4.4-7/all/Release apt/ucs_4.4-0-ucs4.4-7/dists/ucs447/Release test_mirror/ftp/dists/ucs500/Release apt/ucs_5.0-0/dists/ucs500/Release apt/ucs_5.0-0/all/Release 
mirror/ftp/4.4/maintained/4.4-7/dists/ucs447/Release:Version: 4.4.7
mirror/ftp/4.4/maintained/4.4-7/all/Release:Version: 4.4-7
apt/ucs_4.4-0-ucs4.4-7/dists/ucs447/Release:Version: 4.4.7
test_mirror/ftp/dists/ucs500/Release:Version: 5.0-0
apt/ucs_5.0-0/dists/ucs500/Release:Version: 5.0.0
apt/ucs_5.0-0/all/Release:Version: 5.0.0

Debian recommends [0-9.] only, e.g. <https://wiki.debian.org/DebianRepository/Format#Version>.
From that past I remember that `-` was problematic and `Debian 3.1 Sarge` also used `3.1r8`, but still...

Patch for repo-ng is pending in my branch - need to fix another problem there.
Comment 7 Philipp Hahn univentionstaff 2021-02-20 09:45:58 CET
(In reply to Philipp Hahn from comment #6)
> (In reply to Sönke Schwardt-Krummrich from comment #2)
> > I noticed 2 smaller problems:
> ...
> > (In reply to Philipp Hahn from comment #0)
> > > $ cat /etc/apt/preferences
> > > Package: *
> > > Pin: release l=Univention Corporate Server, v=5.0.0
> > > Pin-Priority: 1001
...
> Patch for repo-ng is pending in my branch - need to fix another problem
> there.

DONE: <https://git.knut.univention.de/univention/internal/repo-ng/-/commit/db4d7361e1452262118ae652981132bef5c79d07>

OK: <http://apt.knut.univention.de/dists/ucs500/Release>
Comment 8 Philipp Hahn univentionstaff 2021-02-20 19:04:07 CET
(In reply to Sönke Schwardt-Krummrich from comment #3)
> (In reply to Sönke Schwardt-Krummrich from comment #2)
> > This can be fixed via
> > ucr set \
> >   update/commands/distupgrade='apt-get -o DPkg::Options::=--force-confold -o
> > DPkg::Options::=--force-overwrite -o DPkg::Options::=--force-overwrite-dir
> > --trivial-only=no --assume-yes --quiet=1 --allow-downgrades -u dist-upgrade'
> > \
> >   update/commands/distupgrade/simulate='apt-get -o
> > DPkg::Options::=--force-confold -o DPkg::Options::=--force-overwrite -o
> > DPkg::Options::=--force-overwrite-dir --trivial-only=no --assume-yes
> > --quiet=1 --allow-downgrades -us dist-upgrade' 
> 
> AFAICS we have to set these variables via an erratum/prior to the execution
> of univention-upgrade. Altering these variables during preup.sh is not
> sufficient/too late.

According to <https://docs.software-univention.de/developer-reference-4.4.html#updater:release-update> the preup.sh is executed before any call to those commands, so adding code to preup.sh should work.

[5.0-0] 1c0501bb6a fix[up] Allow package downgrade on upgrade to UCS-5.0
 base/univention-updater/debian/changelog | 6 ++++++
 base/univention-updater/script/postup.sh | 2 +-
 base/univention-updater/script/preup.sh  | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)

Package: univention-updater
Version: 15.0.3-13A~5.0.0.202102201904
Branch: ucs_5.0-0

OK: /usr/share/univention-updater/univention-updater  net --ignoressh --noninteractive
FYI: univention-dhcp failed; see Bug #52259 comment 7
Comment 9 Philipp Hahn univentionstaff 2021-02-22 11:44:54 CET
(In reply to Philipp Hahn from comment #8)
> (In reply to Sönke Schwardt-Krummrich from comment #3)
...
> OK: /usr/share/univention-updater/univention-updater  net --ignoressh
> --noninteractive

FYI: The Release upgrade is performed by `univention-updater`, which uses univention.updater.commands::cmd_upgrade respective cmd_dist_upgrade
The release upgrade is performed in phases:
  update, pre:
  preup, pre:
  preup, main:  updater/scripts/preup.sh
  preup, post:
  update, main: cmd_dist_upgrade
  postup, pre
  postup, main: updater/scripts/postup.sh
  postup, post
  update, post
Comment 10 Sönke Schwardt-Krummrich univentionstaff 2021-02-22 14:48:14 CET
(In reply to Philipp Hahn from comment #7)
> DONE:
> <https://git.knut.univention.de/univention/internal/repo-ng/-/commit/
> db4d7361e1452262118ae652981132bef5c79d07>

OK
 
> OK: <http://apt.knut.univention.de/dists/ucs500/Release>

OK

JFYI:
$ curl -s http://updates-test.knut.univention.de/dists/errata500/Release | grep Version:
Version: 5.0.0-errata

(In reply to Philipp Hahn from comment #8)
> (In reply to Sönke Schwardt-Krummrich from comment #3)
> > AFAICS we have to set these variables via an erratum/prior to the execution
> > of univention-upgrade. Altering these variables during preup.sh is not
> > sufficient/too late.
> 
> According to
> <https://docs.software-univention.de/developer-reference-4.4.html#updater:
> release-update> the preup.sh is executed before any call to those commands,
> so adding code to preup.sh should work.

I was referring to the UCR variables and I still think that the required UCR variables are evaluated before preup.sh is run.
(see also below)

But your approach to add an additional config file for apt is much better since 
it affects only the update to UCS 5.0-0 and saves us from fiddling with manually 
adjusted variables.
 
> Package: univention-updater
> Version: 15.0.3-13A~5.0.0.202102201904
> Branch: ucs_5.0-0
> 
> OK: /usr/share/univention-updater/univention-updater  net --ignoressh
> --noninteractive

OK: univention-upgrade --ignoressh --disable-app-updates

> FYI: The Release upgrade is performed by `univention-updater`, which uses
> univention.updater.commands::cmd_upgrade respective cmd_dist_upgrade
> The release upgrade is performed in phases:
>   update, pre:
>   preup, pre:
>   preup, main:  updater/scripts/preup.sh
>   preup, post:
>   update, main: cmd_dist_upgrade
>   postup, pre
>   postup, main: updater/scripts/postup.sh
>   postup, post
>   update, post

univention.updater.commands::cmd_upgrade is loaded at the startup of 
univention-updater and any change of UCR variables in "preup, main" phase does not affect the loaded cmd_upgrade/cmd_dist_upgrade values.
Comment 11 Florian Best univentionstaff 2021-05-25 16:02:12 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

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