[Bug 2039268] Re: When upgrading to Mantic, it fails to install snap firmware-updater

Nick Rosbrook 2039268 at bugs.launchpad.net
Tue Oct 31 19:37:07 UTC 2023


I ran an upgrade from lunar to mantic where I had snapd from lunar-
proposed installed before the upgrade, and left mantic-proposed enabled
so that snapd from mantic-proposed would be installed during the
upgrade. In that test, firmware-updater was successfully installed.

nr at clean-lunar-amd64:~$ do-release-upgrade -d
Checking for a new Ubuntu release

= Welcome to Ubuntu 23.10 'Mantic Minotaur' =

The Ubuntu team is proud to announce Ubuntu 23.10 'Mantic Minotaur'.

To see what's new in this release, visit:
  https://wiki.ubuntu.com/ManticMinotaur/ReleaseNotes

Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.

We hope you enjoy Ubuntu.

== Feedback and Helping ==

If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at

  http://www.ubuntu.com/community/participate/

Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever.  If you feel
that you have found a bug please read:

  http://help.ubuntu.com/community/ReportingBugs

Then report bugs using apport in Ubuntu.  For example:

  ubuntu-bug linux

will open a bug report in Launchpad regarding the linux package.

If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:

  http://help.ubuntu.com/community/InternetRelayChat
  http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
  http://www.ubuntuforums.org/


== More Information ==

You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:

  http://www.ubuntu.com/


To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:

  http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce


Continue [yN] y
Get:1 Upgrade tool signature [819 B]                                           
Get:2 Upgrade tool [1,271 kB]                                                  
Fetched 1,272 kB in 0s (0 B/s)                                                 
authenticate 'mantic.tar.gz' against 'mantic.tar.gz.gpg' 
extracting 'mantic.tar.gz'
[sudo] password for nr: 


Sorry, try again.
[sudo] password for nr: 

Sorry, try again.
[sudo] password for nr: 

sudo: 3 incorrect password attempts
nr at clean-lunar-amd64:~$ 
nr at clean-lunar-amd64:~$ cd /tmp/ubuntu-release-upgrader-8clgr67q/
nr at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q$ sudo su
[sudo] password for nr: 
root at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF
root at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q# cat <<EOF >/etc/apt/preferences.d/proposed-updates
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 500
EOF
root at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q# apt update && apt install snapd -y
Hit:1 http://security.ubuntu.com/ubuntu lunar-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu lunar InRelease
Hit:3 http://archive.ubuntu.com/ubuntu lunar-updates InRelease
Get:4 http://archive.ubuntu.com/ubuntu lunar-proposed InRelease [255 kB]
Get:5 http://archive.ubuntu.com/ubuntu lunar-proposed/restricted i386 Packages [1,316 B]
Get:6 http://archive.ubuntu.com/ubuntu lunar-proposed/restricted amd64 Packages [123 kB]
Get:7 http://archive.ubuntu.com/ubuntu lunar-proposed/restricted Translation-en [23.1 kB]
Get:8 http://archive.ubuntu.com/ubuntu lunar-proposed/main amd64 Packages [81.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu lunar-proposed/main i386 Packages [23.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu lunar-proposed/main Translation-en [22.1 kB]
Get:11 http://archive.ubuntu.com/ubuntu lunar-proposed/main amd64 DEP-11 Metadata [208 B]
Get:12 http://archive.ubuntu.com/ubuntu lunar-proposed/main DEP-11 48x48 Icons [29 B]
Get:13 http://archive.ubuntu.com/ubuntu lunar-proposed/main DEP-11 64x64 Icons [29 B]
Get:14 http://archive.ubuntu.com/ubuntu lunar-proposed/main DEP-11 64x64 at 2 Icons [29 B]
Get:15 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse i386 Packages [748 B]
Get:16 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse amd64 Packages [748 B]
Get:17 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse Translation-en [584 B]
Get:18 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse amd64 DEP-11 Metadata [2,196 B]
Get:19 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse DEP-11 48x48 Icons [6,500 B]
Get:20 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse DEP-11 64x64 Icons [26.9 kB]
Get:21 http://archive.ubuntu.com/ubuntu lunar-proposed/multiverse DEP-11 64x64 at 2 Icons [29 B]
Get:22 http://archive.ubuntu.com/ubuntu lunar-proposed/universe i386 Packages [7,688 B]
Get:23 http://archive.ubuntu.com/ubuntu lunar-proposed/universe amd64 Packages [23.2 kB]
Get:24 http://archive.ubuntu.com/ubuntu lunar-proposed/universe Translation-en [9,920 B]
Get:25 http://archive.ubuntu.com/ubuntu lunar-proposed/universe amd64 DEP-11 Metadata [2,024 B]
Get:26 http://archive.ubuntu.com/ubuntu lunar-proposed/universe DEP-11 48x48 Icons [5,087 B]
Get:27 http://archive.ubuntu.com/ubuntu lunar-proposed/universe DEP-11 64x64 Icons [5,695 B]
Get:28 http://archive.ubuntu.com/ubuntu lunar-proposed/universe DEP-11 64x64 at 2 Icons [29 B]
Fetched 621 kB in 6s (103 kB/s)                                                                                                                     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
34 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-6.2.0-26 linux-headers-6.2.0-26-generic linux-image-5.19.0-46-generic linux-image-6.2.0-26-generic linux-modules-5.19.0-46-generic
  linux-modules-6.2.0-26-generic linux-modules-extra-5.19.0-46-generic linux-modules-extra-6.2.0-26-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  snapd
1 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
Need to get 26.2 MB of archives.
After this operation, 4,096 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu lunar-proposed/main amd64 snapd amd64 2.59.1+23.04ubuntu1.2 [26.2 MB]
Fetched 26.2 MB in 8s (3,219 kB/s)
(Reading database ... 248469 files and directories currently installed.)
Preparing to unpack .../snapd_2.59.1+23.04ubuntu1.2_amd64.deb ...
Unpacking snapd (2.59.1+23.04ubuntu1.2) over (2.59.1+23.04ubuntu1.1) ...
Setting up snapd (2.59.1+23.04ubuntu1.2) ...
snapd.failure.service is a disabled or a static unit not running, not starting it.
snapd.snap-repair.service is a disabled or a static unit not running, not starting it.
Failed to restart snapd.mounts-pre.target: Operation refused, unit snapd.mounts-pre.target may be requested by dependency only (it is configured to r
efuse manual start/stop).
See system logs and 'systemctl status snapd.mounts-pre.target' for details.
Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 145.
Processing triggers for gnome-menus (3.36.0-1.1ubuntu1) ...
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for dbus (1.14.4-1ubuntu1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu5) ...
root at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q# sed -i 's/lunar/mantic/g' /etc/apt/preferences.d/proposed-updates 
root at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q# exit
exit
nr at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q$ vi DistUpgradeController.py 
nr at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q$ grep -A 10 "Disable proposed on upgrade to a development release." DistUpgradeController.py 
            # Disable proposed on upgrade to a development release.
            #if (not entry.disabled and self.options
            #    and self.options.devel_release == True and
            #    "%s-proposed" % self.fromDist in entry.dist):
            #    logging.debug("upgrade to development release, disabling proposed")
            #    entry.dist = "%s-proposed" % self.toDist
            #    entry.comment += _("Not for humans during development stage of release %s") % self.toDist
            #    entry.disabled = True
            #    continue

            # handle upgrades from a EOL release and check if there
nr at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q$ sudo -E ./mantic --frontend=DistUpgradeViewText

[...]

Processing snap replacements

refreshing snap core22

installing snap firmware-updater

refreshing snap gnome-42-2204

refreshing snap gtk-common-themes

refreshing snap snap-store

refreshing snap snapd-desktop-integration

refreshing snap firefox

Searching for obsolete software
Reading state information... Done

Remove obsolete packages?


90 packages are going to be removed. 

 Continue [yN]  Details [d]y

[...]

System upgrade is complete.

Restart required

To finish the upgrade, a restart is required. 
If you select 'y' the system will be restarted. 

Continue [yN] N
nr at clean-lunar-amd64:/tmp/ubuntu-release-upgrader-8clgr67q$ apt policy snapd
snapd:
  Installed: 2.60.4+23.10.1
  Candidate: 2.60.4+23.10.1
  Version table:
 *** 2.60.4+23.10.1 500
        500 http://archive.ubuntu.com/ubuntu mantic-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.60.4+23.10 500
        500 http://archive.ubuntu.com/ubuntu mantic/main amd64 Packages

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2039268

Title:
  When upgrading to Mantic, it fails to install snap firmware-updater

Status in snapd package in Ubuntu:
  Fix Committed
Status in ubuntu-release-upgrader package in Ubuntu:
  Confirmed
Status in snapd source package in Lunar:
  Fix Committed
Status in snapd source package in Mantic:
  Fix Committed

Bug description:
  [Impact]

  While upgrading to Mantic the following message is reported:

  installing snap firmware-updater
  error: cannot perform the following tasks:
  - Automatically connect eligible plugs and slots of snap "firmware-updater" (internal error: auto-connect of &{"firmware-updater:desktop-legacy" "snapd:desktop-legacy"} failed: snap "snapd" has no slot named "desktop-legacy")

  
  [Test case]

  Confirming the failure:

  $ lxc launch ubuntu:lunar lp-2039268
  Creating lp-2039268
  Starting lp-2039268
  $ lxc exec lp-2039268 bash
  # sed -i -e's/lunar/mantic/' /etc/apt/sources.list && apt update && apt install -y systemd
  # ls -l /run/systemd/generator/snap.mount
  -rw-r--r-- 1 root root 274 Oct 18 05:49 /run/systemd/generator/snap.mount
  # ^D
  $ lxc delete --force lp-2039268

  Confirming the fix:

  $ lxc launch ubuntu:lunar lp-2039268
  Creating lp-2039268
  Starting lp-2039268
  $ lxc exec lp-2039268 bash
  # sed -i -e's/lunar/mantic/' /etc/apt/sources.list && apt update && apt install -y systemd
  # ls -l /run/systemd/generator/snap.mount
  ls: cannot access '/run/systemd/generator/snap.mount': No such file or directory
  # ^D
  $ lxc delete --force lp-2039268

  [Where problems could occur]
  This fix changes how snapd detects at boot time whether a bind remount of /snap with different mount options is necessary.  In unusual circumstances where the rootfs mount options are not what we expect by default in Ubuntu, AND the systemd generator is blocked by a custom security policy from reading /proc/1/mounts, it would get the wrong answer, fail to generate the mount unit under necessary circumstances, and regress the behavior of snapd.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/2039268/+subscriptions




More information about the foundations-bugs mailing list