Hirsute: Cannot install ubuntu-desktop due to unmet dependencies

Bug #1925745 reported by Marian Rainer-Harbach
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Unassigned
Hirsute
Fix Released
High
Unassigned
Impish
Fix Released
High
Unassigned

Bug Description

[Impact]
Phased upgrades were only applied to already installed packages, so if we had a source package foo building foo-core and foo-extra, and foo-core=1 was installed, and we tried to install foo-extra, it would fail because it would try to install 0% foo-extra=2 while blocking foo-core as it's "not for us".

[Test Plan]
The autopkgtests ensure we don't regress and they kind of check this by checking the policy output to see that "foo-extra=2" above is also not the candidate, but foo-extra=1 is (so installing it alongside foo-core=1 would work fine) but they don't install it, so it might be nice to verify this too:

Find a package that is phased, but not for us (maybe just setting the never-include-phased flag?), install one binary from it from the release pocket, and then try to install another from the updates pocket.

At the moment, installing libsystemd-dev would trigger it.

[Where problems could occur]
This is a change in behavior when installing new packages that might cause regression in image building tools for example, if those don't use a chroot (chroots being detected).

Apart from that risk, the change is just removing a flag check inside an if, so not much else.

[Original bug report]

I'm using the ubuntu-21.04-live-server-amd64 ISO to install my hirsute desktop machines so I can automate the installation.

After installation, I'm trying to install the desktop via "apt install ubuntu-desktop".

This fails with:
"Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ubuntu-release-upgrader-gtk : Depends: ubuntu-release-upgrader-core (= 1:21.04.11) but 1:21.04.10 is to be installed
                               Depends: python3-distupgrade (= 1:21.04.11) but 1:21.04.10 is to be installed
E: Unable to correct problems, you have held broken packages."

"apt policy ubuntu-release-upgrader-core" shows:
"ubuntu-release-upgrader-core:
  Installed: 1:21.04.10
  Candidate: 1:21.04.10
  Version table:
     1:21.04.11 1 (phased 20%)
        500 http://at.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 Packages
 *** 1:21.04.10 500
        500 http://at.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages
        100 /var/lib/dpkg/status"

I could not find any information what "phased 20%" means. It's obviously a major problem not being able to install the desktop on a fresh installation.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-meta (Ubuntu):
status: New → Confirmed
Revision history for this message
Manfred Hampl (m-hampl) wrote :
Revision history for this message
Marian Rainer-Harbach (marianrh) wrote :

A workaround is to manually force installation of the dependencies with the newer "phased" versions:
apt install ubuntu-release-upgrader-core=1:21.04.11 python3-distupgrade=1:21.04.11

Revision history for this message
Marian Rainer-Harbach (marianrh) wrote :

Manfred: Thanks! (Offtopic: I googled "apt phased 20%". The "20%" seems to throw Google off completely, it didn't show ANY results related to Linux. Leaving off the 20% yields much better results ;))

tags: added: rls-ii-incoming
affects: ubuntu-meta (Ubuntu) → apt (Ubuntu)
tags: added: fr-1322
Revision history for this message
Julian Andres Klode (juliank) wrote :

OK, so what's going on is that ubuntu-release-upgrader-gtk is not installed, and apt only updates phasing to upgrades, but not new installs. Which fails in this case. Presumably it needs to apply phasing to all packages in a source package if one of them is installed, but that might be slow :(

Revision history for this message
Julian Andres Klode (juliank) wrote :

Or we phase _everything_. Also makes code faster

tags: removed: rls-ii-incoming
Changed in apt (Ubuntu Hirsute):
status: New → Confirmed
Changed in apt (Ubuntu Impish):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.3.5

---------------
apt (2.3.5) experimental; urgency=medium

  * policy: Apply phasing to uninstalled packages too (LP: #1925745)

 -- Julian Andres Klode <email address hidden> Mon, 17 May 2021 11:43:23 +0200

Changed in apt (Ubuntu Impish):
status: Fix Committed → Fix Released
Changed in apt (Ubuntu Hirsute):
importance: Undecided → High
Changed in apt (Ubuntu Impish):
importance: Undecided → High
Revision history for this message
Dan Bungert (dbungert) wrote :

This appears to also be affecting the systemd packages on hirsute at the moment.

The following packages have unmet dependencies:
 libsystemd-dev : Depends: libsystemd0 (= 247.3-3ubuntu3.1) but 247.3-3ubuntu3 is to be installed

Attempting to force an install at version ubuntu3.1 offers to remove init :) and triggers the 'do as I say' behavior.

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Marian, or anyone else affected,

Accepted apt into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/2.2.4ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apt (Ubuntu Hirsute):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Revision history for this message
Dan Bungert (dbungert) wrote :

I attempted to verify.
Verification summary - inconclusive

Steps performed
1. Create container - lxc launch images:ubuntu/hirsute
2. do steps 1 & 2 in https://wiki.ubuntu.com/QATeam/PerformingSRUVerification
   $ dpkg -l apt
[...]
ii apt 2.2.3 amd64 commandline package manager
3. Follow test case, which says:
   'At the moment, installing libsystemd-dev would trigger it.'
4. libsystemd-dev passes, which does not match expectations.

I believe another package is now necessary to trigger the desired test.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (apt/2.2.4ubuntu0.1)

All autopkgtests for the newly accepted apt (2.2.4ubuntu0.1) for hirsute have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-advantage-tools/unknown (amd64, ppc64el, s390x, armhf)
reprotest/0.7.16 (arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/hirsute/update_excuses.html#apt

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Julian Andres Klode (juliank) wrote :

This caused a regression in autopkgtest, causing the ubuntu-advantage-tools failure. We'll have to SRU an autopkgtest that sets always-include-phased-updates as in https://salsa.debian.org/ci-team/autopkgtest/-/merge_requests/125

tags: added: block-proposed-hirsute
Revision history for this message
Marian Rainer-Harbach (marianrh) wrote :

Similar to what Dan wrote in comment #10, my original test case of installing ubuntu-desktop now works even without enabling the proposed repository. So unfortunately I cannot verify the fix now since I cannot reproduce the original error.

Revision history for this message
Julian Andres Klode (juliank) wrote :

We do not have any updates phasing in hirsute atm, so will have to hack in one :)

Revision history for this message
Julian Andres Klode (juliank) wrote :
Download full text (3.5 KiB)

Verification done.

First I downgraded all systemd packages to the release pocket using

# apt install '?installed?version(247.3-3ubuntu3.1$)=247.3-3ubuntu3'

Then I hacked in Phased-Update-Percentage: 0 fields for all src:systemd packages in my local hirsute-updates Packages file in /var/lib/apt/lists using vim, resulting in

# apt install libsystemd-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsystemd-dev : Depends: libsystemd0 (= 247.3-3ubuntu3.1) but 247.3-3ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.

I upgraded libapt-pkg6.0 to 2.2.4ubuntu0.1, yielding

root@h:~# apt install libsystemd-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  libsystemd-dev
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 299 kB of archives.
After this operation, 1153 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu hirsute/main amd64 libsystemd-dev amd64 247.3-3ubuntu3 [299 kB]
Fetched 299 kB in 0s (2408 kB/s)
Selecting previously unselected package libsystemd-dev:amd64.
(Reading database ... 32918 files and directories currently installed.)
Preparing to unpack .../libsystemd-dev_247.3-3ubuntu3_amd64.deb ...
Unpacking libsystemd-dev:amd64 (247.3-3ubuntu3) ...
Setting up libsystemd-dev:amd64 (247.3-3ubuntu3) ...
Processing triggers for man-db (2.9.4-2) ...
Scanning processes...
Scanning candidates...

Yay!

Phasing back to 100 made it upgrade to -updates as expected:

root@h:~# sed -i "s#Phased-Update-Percentage: 0#Phased-Update-Percentage: 100#g" /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hirsute-updates_main_binary-amd64_Packages
root@h:~# apt install libsystemd-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  libnss-systemd libpam-systemd libsystemd0 systemd systemd-sysv systemd-timesy...

Read more...

tags: added: verification-done verification-done-hirsute
removed: verification-needed verification-needed-hirsute
Revision history for this message
Julian Andres Klode (juliank) wrote :

autopkgtest SRUs are in bug 1934100

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, the autopkgtest regression now fixed and released, let's unblock.

tags: removed: block-proposed-hirsute
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.2.4ubuntu0.1

---------------
apt (2.2.4ubuntu0.1) hirsute; urgency=medium

  * Merge 2.2.4 from Debian unstable
  * Extend the JSON hook fixes with support for version 0.2 (LP: #1926150)
    - json: Add origins fields to version
    - upgrade: Add JSON hook support (AptCli::Hooks::Upgrade)
    - json: Add `package-list` and `statistics` install hooks
    - json: Hook protocol 0.2 (added upgrade,downgrade,reinstall modes)

apt (2.2.4) unstable; urgency=medium

  [ Julian Andres Klode ]
  * Various bugfixes to the JSON hooks:
    - encoder fixes:
      + json: Escape strings using \u escape sequences, add test
      + json: Actually pop states
      + json: Encode NULL strings as null
    - json: Flush standard file descriptors before calling hooks
      (this avoids output from hooks in middle of apt output)
    - Non-installed JSON changes:
      + test/json: Make the test hook more reliable
      + Fix a typo in json-hooks-protocol.md (thanks to Brian Murray)
  * Avoid infinite loop on EOF on media change prompt (LP: #1928687)
  * Turn TLS handshake issues into transient errors (LP: #1928100),
    this makes behavior consistent with TCP and enables Acquire::Retries
  * policy: Apply phasing to uninstalled packages too (LP: #1925745),
    this prevents inconsistencies when installing new binaries that depend
    on the same version of an already installed binary.

  [ David Kalnischkies ]
  * URI encode Filename field of Packages files (again). This fixes a
    regression introduced in 2.1.15 that causes download failures of
    packages with an epoch included in their filename (LP: #1931874).

 -- Julian Andres Klode <email address hidden> Mon, 14 Jun 2021 16:27:40 +0200

Changed in apt (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for apt has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.