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
72
This bug affects 15 people
Affects Status Importance Assigned to Milestone
snapd
Won't Fix
Undecided
Unassigned
dpkg (Ubuntu)
In Progress
Critical
Unassigned
Trusty
Confirmed
Undecided
Unassigned
Xenial
Confirmed
Undecided
Unassigned
Yakkety
Invalid
Undecided
Unassigned
Zesty
Confirmed
Undecided
Unassigned
snapd (Ubuntu)
In Progress
Critical
Michael Vogt
Trusty
In Progress
Undecided
Unassigned
Xenial
Confirmed
Undecided
Unassigned
Yakkety
Invalid
Undecided
Unassigned
Zesty
Confirmed
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)

Revision history for this message
Luke L (lukedeux) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Barbarossa (dbarbarossa) wrote :

same problem

Revision history for this message
philwebman (philwebman) wrote :

Same problem here too.

Revision history for this message
Łukasz Karbownik (meaven) wrote :

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

Revision history for this message
paride (fparide) wrote :

Same problem

Revision history for this message
mike (slicktrick) wrote :

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

Revision history for this message
Ilias (ikasou) wrote :

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

Revision history for this message
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.

Revision history for this message
Thomas Steiger (7-tom-z) wrote :

Same for me - breaks fresh install.

Revision history for this message
Sergey Melnichenko (sergey.m) wrote :

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

Revision history for this message
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

Revision history for this message
mike (slicktrick) wrote :

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

Revision history for this message
mesiu84 (mesiu84) wrote :

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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
Adam Conrad (adconrad) wrote :

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

Revision history for this message
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.

Revision history for this message
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)
description: updated
Michael Vogt (mvo)
description: updated
Revision history for this message
Michael Vogt (mvo) wrote :
Michael Vogt (mvo)
description: updated
description: updated
tags: added: patch
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Barbarossa (dbarbarossa) wrote :

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

Revision history for this message
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
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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
Revision history for this message
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)
Revision history for this message
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
Revision history for this message
Bruce Millar (brmillar) wrote :

Is there a fix for this problem?

dino99 (9d9)
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
Revision history for this message
dino99 (9d9) wrote :

@Bruce

follow #18 advice; that's easy.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Michael, are you still actively working on this issue?

Revision history for this message
Michael Vogt (mvo) wrote :

I'm closing the snapd task, this is a bug in dpkg.

Changed in snapd:
status: New → Won't Fix
a59ff5 (a59ff5a59ff5)
Changed in snapd (Ubuntu Zesty):
assignee: nobody → Slavik (slavikstar)
a59ff5 (a59ff5a59ff5)
information type: Public → Private
a59ff5 (a59ff5a59ff5)
description: updated
a59ff5 (a59ff5a59ff5)
Changed in snapd (Ubuntu Xenial):
status: Confirmed → In Progress
Changed in snapd (Ubuntu Zesty):
status: Confirmed → In Progress
Changed in dpkg (Ubuntu Trusty):
status: Confirmed → In Progress
Changed in dpkg (Ubuntu Xenial):
status: Confirmed → In Progress
Changed in dpkg (Ubuntu Zesty):
status: Confirmed → In Progress
a59ff5 (a59ff5a59ff5)
Changed in snapd (Ubuntu Yakkety):
status: Invalid → In Progress
Changed in snapd (Ubuntu Zesty):
assignee: a59ff5 (a59ff5a59ff5) → nobody
Changed in snapd (Ubuntu):
assignee: Michael Vogt (mvo) → nobody
Changed in dpkg (Ubuntu Yakkety):
status: Invalid → In Progress
a59ff5 (a59ff5a59ff5)
information type: Private → Public
Changed in snapd (Ubuntu):
status: In Progress → Fix Released
Changed in dpkg (Ubuntu):
status: In Progress → Fix Released
Changed in dpkg (Ubuntu Trusty):
status: In Progress → Fix Released
Changed in dpkg (Ubuntu Xenial):
status: In Progress → Fix Released
Changed in dpkg (Ubuntu Yakkety):
status: In Progress → Fix Released
Changed in snapd (Ubuntu Trusty):
status: In Progress → Fix Released
a59ff5 (a59ff5a59ff5)
Changed in snapd (Ubuntu Xenial):
status: In Progress → Fix Released
Changed in snapd (Ubuntu Yakkety):
status: In Progress → Fix Released
Changed in snapd (Ubuntu Zesty):
status: In Progress → Fix Released
a59ff5 (a59ff5a59ff5)
Changed in dpkg (Ubuntu Zesty):
status: In Progress → Fix Released
Colin Watson (cjwatson)
Changed in snapd (Ubuntu Xenial):
status: Fix Released → Confirmed
Changed in snapd (Ubuntu Zesty):
status: Fix Released → Confirmed
Changed in dpkg (Ubuntu Trusty):
status: Fix Released → Confirmed
Changed in dpkg (Ubuntu Xenial):
status: Fix Released → Confirmed
Changed in dpkg (Ubuntu Zesty):
status: Fix Released → Confirmed
Changed in snapd (Ubuntu Yakkety):
status: Fix Released → Invalid
Changed in snapd (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Changed in dpkg (Ubuntu Yakkety):
status: Fix Released → Invalid
Changed in snapd (Ubuntu):
status: Fix Released → In Progress
Changed in dpkg (Ubuntu):
status: Fix Released → In Progress
Colin Watson (cjwatson)
Changed in snapd (Ubuntu Trusty):
status: Fix Released → In Progress
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.