Problem:
After running univention-upgrade, you may observe that the ucs-releases.json file appears to be reset or incomplete. This issue persists until a manual execution of univention-repository-update net is performed. You are seeking clarification on this behavior and a suitable way to automate the resolution.
Environment:
- Univention Corporate Server (UCS)
- Local repository server configured for package distribution
Diagnosis:
The behavior you’re experiencing is understood and relates to the different functionalities of two similarly named tools:
-
univention-repository-update
This command updates the packages within your local UCS repository. It scans the repository metadata and ensures it is current based on existing local data. It does not fetch new metadata or release information from an external source. -
univention-repository-update net
In contrast, this command synchronizes your local repository with an external repository server, typically defined in the Univention Configuration Registry (UCR) variablerepository/mirror/server.
By default, this server is:
updates.software-univention.de
Running this command retrieves updated package data, metadata, and the completeucs-releases.jsonfile from the external repository source.
Reference: UCS Manual – Creating and Updating a Local Repository
Solution:
To ensure that your local repository is fully synchronized, especially with updated release metadata, you should verify the correct external server is configured.
Check the current server configuration with:
ucr get repository/mirror/server
Ensure the output matches your desired upstream server (e.g., updates.software-univention.de). If not, set it accordingly:
ucr set repository/mirror/server='updates.software-univention.de'
Workaround and Automation:
The observed behavior suggests that while univention-upgrade internally runs univention-repository-update, it does not perform a full synchronization like univention-repository-update net. As a result, release metadata like ucs-releases.json may not reflect all available UCS versions after the upgrade.
Your current manual workaround of executing univention-repository-update net after each upgrade is effective and recommended.
To automate this, include the synchronization command directly after the univention-upgrade call in your scheduled (cron) job.
Example Cron Job:
apt update && \
univention-upgrade --updateto=$(ucr get version/version)-99 \
--ignoressh --ignoreterm --noninteractive \
--enable-app-updates \
--username Administrator \
--pwdfile /tmp/.join-scripts && \
univention-repository-update net
This ensures that once the upgrade is complete, the repository is fully synchronized with the external source, and the ucs-releases.json file is updated accordingly.
Summary:
- Use
univention-repository-updateto update local repository metadata. - Use
univention-repository-update netto fetch updates and metadata from the external UCS repository server. - Automate the process post-upgrade to ensure consistent repository state.