apt-get dist-upgrade failed

Bug #1760979 reported by Seth Arnold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Julian Andres Klode
dpkg (Ubuntu)
Fix Released
Medium
Julian Andres Klode
packagekit (Ubuntu)
Fix Released
Medium
Unassigned
python-apt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Hello, something went amiss with a recent apt-get -u dist-upgrade:

root@wopr:~# apt-get update && apt-get -u dist-upgrade
Get:1 file:/srv/mirror/ubuntu xenial InRelease [247 kB]
Get:1 file:/srv/mirror/ubuntu xenial InRelease [247 kB]
Get:2 file:/srv/mirror/ubuntu xenial-updates InRelease [102 kB]
Get:2 file:/srv/mirror/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:4 file:/srv/mirror/ubuntu xenial-updates/main Sources [302 kB]
Get:5 file:/srv/mirror/ubuntu xenial-updates/universe Sources [199 kB]
Get:6 file:/srv/mirror/ubuntu xenial-updates/main amd64 Packages [746 kB]
Get:7 file:/srv/mirror/ubuntu xenial-updates/main i386 Packages [691 kB]
Get:8 file:/srv/mirror/ubuntu xenial-updates/main Translation-en [309 kB]
Get:9 file:/srv/mirror/ubuntu xenial-updates/universe amd64 Packages [616 kB]
Get:10 file:/srv/mirror/ubuntu xenial-updates/universe i386 Packages [570 kB]
Get:11 file:/srv/mirror/ubuntu xenial-updates/universe Translation-en [248 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/main Sources [119 kB]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [62.4 kB]
Get:14 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [467 kB]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [421 kB]
Get:16 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [201 kB]
Get:17 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [340 kB]
Get:18 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [296 kB]
Get:19 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [126 kB]
Fetched 2,135 kB in 1s (1,520 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libzstd0 linux-headers-4.4.0-109 linux-headers-4.4.0-109-generic linux-image-4.4.0-109-generic
  linux-image-extra-4.4.0-109-generic linux-signed-image-4.4.0-109-generic linux-tools-4.4.0-109
  linux-tools-4.4.0-109-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  apt apt-transport-https apt-utils initramfs-tools initramfs-tools-bin initramfs-tools-core libapt-inst2.0
  libapt-pkg5.0 libpam-systemd libpci-dev libpci3 libsystemd0 libudev-dev libudev1 lshw makedumpfile pciutils
  python-crypto systemd systemd-sysv udev
21 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 246 kB/8,157 kB of archives.
After this operation, 16.4 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 file:/srv/mirror/ubuntu xenial-updates/main amd64 libapt-pkg5.0 amd64 1.2.26 [706 kB]
Get:2 file:/srv/mirror/ubuntu xenial-updates/main amd64 libapt-inst2.0 amd64 1.2.26 [55.4 kB]
Get:3 file:/srv/mirror/ubuntu xenial-updates/main amd64 apt amd64 1.2.26 [1,043 kB]
Get:4 file:/srv/mirror/ubuntu xenial-updates/main amd64 apt-utils amd64 1.2.26 [197 kB]
Get:5 file:/srv/mirror/ubuntu xenial-updates/main amd64 libudev-dev amd64 229-4ubuntu21.2 [150 kB]
Get:6 file:/srv/mirror/ubuntu xenial-updates/main amd64 libsystemd0 amd64 229-4ubuntu21.2 [205 kB]
Get:7 file:/srv/mirror/ubuntu xenial-updates/main amd64 libpam-systemd amd64 229-4ubuntu21.2 [115 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/main amd64 python-crypto amd64 2.6.1-6ubuntu0.16.04.3 [246 kB]
Get:9 file:/srv/mirror/ubuntu xenial-updates/main amd64 systemd amd64 229-4ubuntu21.2 [3,634 kB]
Get:10 file:/srv/mirror/ubuntu xenial-updates/main amd64 udev amd64 229-4ubuntu21.2 [993 kB]
Get:11 file:/srv/mirror/ubuntu xenial-updates/main amd64 libudev1 amd64 229-4ubuntu21.2 [54.4 kB]
Get:12 file:/srv/mirror/ubuntu xenial-updates/main amd64 initramfs-tools all 0.122ubuntu8.11 [8,590 B]
Get:13 file:/srv/mirror/ubuntu xenial-updates/main amd64 initramfs-tools-core all 0.122ubuntu8.11 [42.9 kB]
Get:14 file:/srv/mirror/ubuntu xenial-updates/main amd64 initramfs-tools-bin amd64 0.122ubuntu8.11 [9,592 B]
Get:15 file:/srv/mirror/ubuntu xenial-updates/main amd64 systemd-sysv amd64 229-4ubuntu21.2 [11.9 kB]
Get:16 file:/srv/mirror/ubuntu xenial-updates/main amd64 apt-transport-https amd64 1.2.26 [26.1 kB]
Get:17 file:/srv/mirror/ubuntu xenial-updates/main amd64 pciutils amd64 1:3.3.1-1.1ubuntu1.2 [234 kB]
Get:18 file:/srv/mirror/ubuntu xenial-updates/main amd64 libpci-dev amd64 1:3.3.1-1.1ubuntu1.2 [42.7 kB]
Get:19 file:/srv/mirror/ubuntu xenial-updates/main amd64 libpci3 amd64 1:3.3.1-1.1ubuntu1.2 [24.5 kB]
Get:20 file:/srv/mirror/ubuntu xenial-updates/main amd64 lshw amd64 02.17-1.1ubuntu3.5 [215 kB]
Get:21 file:/srv/mirror/ubuntu xenial-updates/main amd64 makedumpfile amd64 1:1.5.9-5ubuntu0.6 [143 kB]
Fetched 246 kB in 0s (491 kB/s)
(Reading database ... 186732 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.2.26_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.2.26) over (1.2.25) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libapt-pkg5.0:amd64 (1.2.26) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 186732 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.2.26_amd64.deb ...
Unpacking libapt-inst2.0:amd64 (1.2.26) over (1.2.25) ...
Preparing to unpack .../a/apt/apt_1.2.26_amd64.deb ...
Unpacking apt (1.2.26) over (1.2.25) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up apt (1.2.26) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
dpkg: error: dpkg status database is locked by another process
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@wopr:~# apt-get update && apt-get -u dist-upgrade
Get:1 file:/srv/mirror/ubuntu xenial InRelease [247 kB]
Get:1 file:/srv/mirror/ubuntu xenial InRelease [247 kB]
Get:2 file:/srv/mirror/ubuntu xenial-updates InRelease [102 kB]
Get:2 file:/srv/mirror/ubuntu xenial-updates InRelease [102 kB]
Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 apt-utils : Depends: apt (= 1.2.25) but 1.2.26 is installed
E: Unmet dependencies. Try using -f.
root@wopr:~# ubuntu-bug apt

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt 1.2.26
ProcVersionSignature: Ubuntu 4.4.0-108.131-generic 4.4.98
Uname: Linux 4.4.0-108-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu2.15
Architecture: amd64
Date: Tue Apr 3 12:57:30 2018
InstallationDate: Installed on 2016-04-04 (729 days ago)
InstallationMedia: Ubuntu-Server 16.04 LTS "Xenial Xerus" - Beta amd64 (20160325)
ProcEnviron:
 TERM=rxvt-unicode
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Seth Arnold (seth-arnold) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

Well, yes, that happens sometimes. There is a race, because apt needs to release the dpkg lock before starting dpkg. Guess I should poke guillem about https://lists.debian.org/debian-dpkg/2017/01/msg00044.html again.

Changed in apt (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in dpkg (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in apt (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
Changed in dpkg (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
Revision history for this message
Seth Arnold (seth-arnold) wrote :

I'm glad it's not a catastrophe due to a regression in this specific update, but it's unfortunate that it looks like it will take a lot of work to reliably resolve.

Thanks

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

I think with basically trivial patches in just dpkg, apt, python-apt, and packagekit we should have solved most of that. At least the apt tools, and any tool using python-apt or packagekit will be safe from being interfered with.

Changed in python-apt (Ubuntu):
status: New → Triaged
Changed in packagekit (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in python-apt (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Julian Andres Klode (juliank) wrote :

Note that dpkg and apt need to go first, then we can add support to other tools. The solution is not entirely optimal (at least theoretically): Crashing the frontend releases the frontend lock, so other frontends could start doing stuff (though probably fail at dpkg lock). It would have been nice to be able to have dpkg inherit the lock from apt, but that was sadly not possible with our locking approach.

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

Fixed in cosmic. Need to get a clean list of bugs to SRU the changes, might be opening one per package and/or reusing existing ones.

Changed in apt (Ubuntu):
status: Triaged → Fix Released
Changed in dpkg (Ubuntu):
status: Triaged → Fix Released
Changed in packagekit (Ubuntu):
status: Triaged → Fix Released
Changed in python-apt (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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