package snapd 2.23.1 failed to install/upgrade: trying to overwrite '/etc/apparmor.d/usr.lib.snapd.snap-confine', which is also in package snap-confine 2.23.1

Bug #1673247 reported by Luke L on 2017-03-15
62
This bug affects 11 people
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Critical
Unassigned
Trusty
Undecided
Unassigned
Xenial
Undecided
Unassigned
Yakkety
Undecided
Unassigned
Zesty
Undecided
Unassigned
snapd (Ubuntu)
Critical
Michael Vogt
Trusty
Undecided
Unassigned
Xenial
Undecided
Unassigned
Yakkety
Undecided
Unassigned
Zesty
Undecided
Unassigned

Bug Description

When the ubuntu installer runs it has an option to download updates during the install. When this happens snapd/snap-confine 2.22.6 are installed on /target. The upgrade brings in snapd/snap-confine 2.23.1 which has a conffile in /etc/apparmor.d/usr.lib.snapd.snap-confine. The snapd packages declares a breaks/replaces: snapd-confine (<< 2.23) which works correctly on regular upgrades. However it does fail on upgrades with the "--root=/target" that is used by ubiquity. After a bit of debugging it turns out the reason is that
src/archives.c:tarobject() has a check for obsolete conffiles in the block
around "Is the file an obsolete conffile ...". There is a stat() here that
checks that the conff->name and the fnamevb are the same file. This check
fails to take the instdir into account and therefore the loop does not
continue but falls through to the "does_replace()" checks.

--------------------------------------------
Snap 2.23.1 fails to upgrade from 2.21.

Known facts:
- reporters (and apport) indicate it fails during the install via the live-cd
- not reproducible so far on an already installed system
- breaks/replaces of snapd are correct
- When adding "xenial-proposed" to apt-setup in ubiquity and installing

Cause:
- when ubiquity runs it uses "dpkg --root=/target --unpack ..." - however when doing the conffile checking dpkg does not handle the "--root" parameter correctly and checks something against "/" instead of "/target".

---------------------------------------------
I really don't know what else to add...

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: snapd 2.23.1
ProcVersionSignature: Ubuntu 4.8.0-36.36~16.04.1-generic 4.8.11
Uname: Linux 4.8.0-36-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
CasperVersion: 1.376.2
Date: Wed Mar 15 16:03:33 2017
DuplicateSignature:
 package:snapd:2.23.1
 Unpacking snapd (2.23.1) over (2.21) ...
 dpkg: error processing archive /target/var/cache/apt/archives/snapd_2.23.1_amd64.deb (--unpack):
  trying to overwrite '/etc/apparmor.d/usr.lib.snapd.snap-confine', which is also in package snap-confine 2.23.1
ErrorMessage: trying to overwrite '/etc/apparmor.d/usr.lib.snapd.snap-confine', which is also in package snap-confine 2.23.1
LiveMediaBuild: Ubuntu-GNOME 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.19
SourcePackage: snapd
Title: package snapd 2.23.1 failed to install/upgrade: trying to overwrite '/etc/apparmor.d/usr.lib.snapd.snap-confine', which is also in package snap-confine 2.23.1
UpgradeStatus: No upgrade log present (probably fresh install)

Luke L (lukedeux) wrote :
tags: removed: need-duplicate-check
Launchpad Janitor (janitor) wrote :

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

Changed in snapd (Ubuntu):
status: New → Confirmed
Barbarossa (dbarbarossa) wrote :

same problem

philwebman (philwebman) wrote :

Same problem here too.

Łukasz Karbownik (meaven) wrote :

Same here but encountered this error during Ubuntu 16.10 installation and it breaks installation process.

paride (fparide) wrote :

Same problem

mike (slicktrick) wrote :

I have had the same error with 16.04 16.10 and kbuntu 16.10 cannot complete fresh install.

Ilias (ikasou) wrote :

Same on 16.10 been driving me nuts - aren't those ISO's supposed to be frozen??

Stephen Balaban (launahpad) wrote :

Reporting the same problem across multiple computers, both 16.04 and 16.10. (OEM Install / Graphical Install / Try => Install)

Clearly a breaking change was introduced.

Thomas Steiger (7-tom-z) wrote :

Same for me - breaks fresh install.

Sergey Melnichenko (sergey.m) wrote :

Tried to installed Ubuntu 16.04.2 - same problem. Give us 16.04 - STABLE version!!!!

Stephen Balaban (launahpad) wrote :

**Solution: Unplug your internet connection / disable wifi.**

Quick fix is to have no active connection during installation. Just unplug your ethernet cable.

Up vote this on stack overflow so people know about it.
http://askubuntu.com/a/893497/665927

mike (slicktrick) wrote :

Post # 12 worked for me. disconnected the ethernet cable no wifi, and installed flawlessly.

mesiu84 (mesiu84) wrote :

How am I supposed to disconnect web server that is online? It's a joke I guess

Stephen Balaban (launahpad) wrote :

@#14, not a joke. Obviously that fix only works if you're physically next to your machine and not if you're sshing in.

Thomas Steiger (7-tom-z) wrote :

When I did this there was a crash later with grub that asked me to upload a bug report. Does anyone know what that bug might be? I am betting that that symptom is being reported far more frequently than this actual cause issue.

Adam Conrad (adconrad) wrote :

Removed snapd 2.23.1 from trusty/xenial/yakkety. Will copy 2.22.6 back in once the deleted go through.

Changed in snapd (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
importance: Undecided → Critical
Adam Conrad (adconrad) wrote :

For people already bitten by this, the workaround would be to remove snap-confine. snapd no longer depends on it.

Thomas Steiger (7-tom-z) wrote :

Quick update as I have tested a number of install options on a Thinkpad 460s.

1 - Secure Boot, UEFI, no Wifi - install works and all good after apt-get update,upgrade
2 - No Secure Boot, UEFI, no Wifi - install works and all good after apt-get update, upgrade
3 - Same as 2, enabled Wifi, but no Update during install - Fails
      This one was interesting as I assumed the issue was part of the upgrade at install scripts... not so.
4 - Legacy Bios - install USB will not even boot. Likely unrelated and an issue in setup.

Also the mentioned AskUbuntu question has been flagged as attracting low quality answers by some dumba$$ algorithm so cannot be update without 10 rep points. The unfortunate downside of automated SPAM.

Regardless a networkless install seems to be a work around for now, and upgrading after seems to work fine.

Seth Arnold (seth-arnold) wrote :

Thomas, there's usually no need to keep adding answers to a stack exchange post once there's one correct answer on the post. Just upvote the correct one and it'll migrate to the top. More answers won't help anything.

Thanks

Michael Vogt (mvo) on 2017-03-16
description: updated
Michael Vogt (mvo) on 2017-03-16
description: updated
Michael Vogt (mvo) wrote :
Michael Vogt (mvo) on 2017-03-16
description: updated
description: updated
tags: added: patch
Michael Vogt (mvo) wrote :
Barbarossa (dbarbarossa) wrote :

worked for me. no wifi - installed without any problem.

Michael Vogt (mvo) wrote :
Changed in dpkg (Ubuntu):
status: New → In Progress
importance: Undecided → Critical
Changed in snapd (Ubuntu):
status: Confirmed → Invalid
Changed in snapd (Ubuntu Trusty):
status: New → Invalid
status: Invalid → In Progress
Changed in snapd (Ubuntu):
status: Invalid → In Progress
Michael Vogt (mvo) wrote :
Michael Vogt (mvo) wrote :
Michael Vogt (mvo) wrote :
Michael Vogt (mvo) wrote :
Michael Vogt (mvo) wrote :

Once dpkg is SRUed we will have to upload a new snapd with a versioned "Pre-Depends" on the new dpkg.

Seth Arnold (seth-arnold) wrote :

mvo, will the installer be intelligent enough to install dpkg in a separate install run before all the other packages?

Thanks

Launchpad Janitor (janitor) wrote :

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

Changed in dpkg (Ubuntu Trusty):
status: New → Confirmed
Changed in dpkg (Ubuntu Xenial):
status: New → Confirmed
Changed in dpkg (Ubuntu Yakkety):
status: New → Confirmed
Changed in snapd (Ubuntu Xenial):
status: New → Confirmed
Changed in snapd (Ubuntu Yakkety):
status: New → Confirmed
Reinhardt Pflanz (sajaha-e) wrote :

German Languages ?

Changed in dpkg (Ubuntu Xenial):
assignee: nobody → Reinhardt Pflanz (sajaha-e)
Changed in dpkg (Ubuntu Trusty):
assignee: nobody → Néstor O. Gozza (mangosta11)
Launchpad Janitor (janitor) wrote :

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

Changed in dpkg (Ubuntu Zesty):
status: New → Confirmed
Changed in snapd (Ubuntu Zesty):
status: New → Confirmed
Bruce Millar (brmillar) wrote :

Is there a fix for this problem?

dino99 (9d9) on 2018-02-06
Changed in dpkg (Ubuntu Trusty):
assignee: Néstor O. Gozza (mangosta11) → nobody
Changed in dpkg (Ubuntu Xenial):
assignee: Reinhardt Pflanz (sajaha-e) → nobody
Changed in dpkg (Ubuntu Yakkety):
status: Confirmed → Invalid
Changed in snapd (Ubuntu Yakkety):
status: Confirmed → Invalid
dino99 (9d9) wrote :

@Bruce

follow #18 advice; that's easy.

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

Duplicates of this bug

Other bug subscribers