[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#740843: apt: fails to upgrade the fglrx family of packages with multiarch



Package: apt
Version: 0.9.7.9+deb7u1
Severity: normal

unattended-upgrades was unable to upgrade the fglrx family of packages
from one version to the next on SteamOS, and I've been able to reproduce
a simpler form of the same situation with both apt-get and
unattended-upgrades, in a Debian stable or testing chroot.

== preconditions ==

The test set of packages are created by the attached files (put them all
in the same directory and run make), and are a simplified version of the
original situation involving fglrx:

    foo-driver amd64 installed
        Depends: libfoo (= VERSION)
        Recommends: libgl1-foo-glx (= VERSION)
        Breaks: libgl1-foo-glx (<< VERSION)
        Breaks: libgl1-foo-glx (>> VERSION)

    libgl1-foo-glx both amd64 and i386 installed
        Depends: libfoo (= VERSION)

    libfoo both amd64 and i386 installed

The only configured apt repository at the time of the upgrade contains
packages of the same names, with the same relationships, but a higher
version. The Makefile rules for "test_apt_in_chroot" and
"test_uu_in_chroot" indicate the specifics of how I tested this, in a
small chroot environment (build-essential + aptitude + sudo + vim).

== expected result ==

I would expect the problem resolution to involve temporarily
deconfiguring foo-driver and libgl1-foo-glx, upgrading both flavours of
libfoo, configuring libgl1-foo-glx, and finally configuring foo-driver.

== actual result ==

However, what actually happens is that apt gets part-way through the
upgrade, but does not deconfigure foo-driver in favour of the new
libgl1-foo-glx:

> The following packages will be upgraded:
>   foo-driver libfoo libfoo:i386 libgl1-foo-glx libgl1-foo-glx:i386
> 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> Need to get 0 B/3538 B of archives.
> After this operation, 0 B of additional disk space will be used.
> Do you want to continue? [Y/n]
[...]
> (Reading database ... 16779 files and directories currently
> installed.)
> Preparing to unpack .../foo/libgl1-foo-glx_2_amd64.deb ...
> De-configuring libgl1-foo-glx:i386 (1) ...
> Unpacking libgl1-foo-glx:amd64 (2) over (1) ...
> Preparing to unpack .../foo/libgl1-foo-glx_2_i386.deb ...
> Unpacking libgl1-foo-glx:i386 (2) over (1) ...
> Preparing to unpack .../main/f/foo/libfoo_2_i386.deb ...
> De-configuring libfoo:amd64 (1) ...
> Unpacking libfoo:i386 (2) over (1) ...
> Preparing to unpack .../main/f/foo/libfoo_2_amd64.deb ...
> Unpacking libfoo:amd64 (2) over (1) ...
> Setting up libfoo:amd64 (2) ...
> Setting up libfoo:i386 (2) ...
> dpkg: dependency problems prevent configuration of
> libgl1-foo-glx:amd64:
>  foo-driver (1) breaks libgl1-foo-glx (>> 1) and is installed.
>   Version of libgl1-foo-glx:amd64 to be configured is 2.
>
> dpkg: error processing package libgl1-foo-glx:amd64 (--configure):
>  dependency problems - leaving unconfigured
> dpkg: dependency problems prevent configuration of
> libgl1-foo-glx:i386:
>  foo-driver (1) breaks libgl1-foo-glx (>> 1) and is installed.
>   Version of libgl1-foo-glx:i386 to be configured is 2.
>
> dpkg: error processing package libgl1-foo-glx:i386 (--configure):
>  dependency problems - leaving unconfigured
> Errors were encountered while processing:
>  libgl1-foo-glx:amd64
>  libgl1-foo-glx:i386

This seems to be multiarch-related: not installing the i386 packages
leads to the upgrade working fine.

== applicability to "real life" ==

In the real situation on SteamOS, "foo" is replaced with "fglrx"
throughout, the packages contain files, and there are additional
dependencies on packages that are not involved in the problematic
transaction. The failure mode appears to be the same.

Package versions etc. below are from a wheezy/amd64 chroot that can
reproduce the bug.

    S

-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "1";
APT::Install-Suggests "0";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image.*";
APT::NeverAutoRemove:: "^kfreebsd-image.*";
APT::NeverAutoRemove:: "^linux-restricted-modules.*";
APT::NeverAutoRemove:: "^linux-ubuntu-modules-.*";
APT::NeverAutoRemove:: "^gnumach$";
APT::NeverAutoRemove:: "^gnumach-image.*";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Never-MarkAuto-Sections:: "oldlibs";
APT::Never-MarkAuto-Sections:: "restricted/oldlibs";
APT::Never-MarkAuto-Sections:: "universe/oldlibs";
APT::Never-MarkAuto-Sections:: "multiverse/oldlibs";
APT::Architectures "";
APT::Architectures:: "amd64";
APT::Architectures:: "i386";
APT::Compressor "";
APT::Compressor::. "";
APT::Compressor::.::Name ".";
APT::Compressor::.::Extension "";
APT::Compressor::.::Binary "";
APT::Compressor::.::Cost "1";
APT::Compressor::gzip "";
APT::Compressor::gzip::Name "gzip";
APT::Compressor::gzip::Extension ".gz";
APT::Compressor::gzip::Binary "gzip";
APT::Compressor::gzip::Cost "2";
APT::Compressor::gzip::CompressArg "";
APT::Compressor::gzip::CompressArg:: "-9n";
APT::Compressor::gzip::UncompressArg "";
APT::Compressor::gzip::UncompressArg:: "-d";
APT::Compressor::bzip2 "";
APT::Compressor::bzip2::Name "bzip2";
APT::Compressor::bzip2::Extension ".bz2";
APT::Compressor::bzip2::Binary "bzip2";
APT::Compressor::bzip2::Cost "3";
APT::Compressor::bzip2::CompressArg "";
APT::Compressor::bzip2::CompressArg:: "-9";
APT::Compressor::bzip2::UncompressArg "";
APT::Compressor::bzip2::UncompressArg:: "-d";
APT::Compressor::xz "";
APT::Compressor::xz::Name "xz";
APT::Compressor::xz::Extension ".xz";
APT::Compressor::xz::Binary "xz";
APT::Compressor::xz::Cost "4";
APT::Compressor::xz::CompressArg "";
APT::Compressor::xz::CompressArg:: "-6";
APT::Compressor::xz::UncompressArg "";
APT::Compressor::xz::UncompressArg:: "-d";
APT::Compressor::lzma "";
APT::Compressor::lzma::Name "lzma";
APT::Compressor::lzma::Extension ".lzma";
APT::Compressor::lzma::Binary "xz";
APT::Compressor::lzma::Cost "5";
APT::Compressor::lzma::CompressArg "";
APT::Compressor::lzma::CompressArg:: "--format=lzma";
APT::Compressor::lzma::CompressArg:: "-9";
APT::Compressor::lzma::UncompressArg "";
APT::Compressor::lzma::UncompressArg:: "--format=lzma";
APT::Compressor::lzma::UncompressArg:: "-d";
APT::Compressor::::Name "";
APT::Compressor::::Extension ".";
APT::Compressor::::Binary "";
APT::Compressor::::Cost "100";
APT::Compressor::::CompressArg "";
APT::Compressor::::CompressArg:: "-9";
APT::Compressor::::UncompressArg "";
APT::Compressor::::UncompressArg:: "-d";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::mirrors "mirrors/";
Dir::State::extended_states "extended_states";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::netrc "auth.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::solvers "";
Dir::Bin::solvers:: "/usr/lib/apt/solvers";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Bin::bzip2 "/bin/bzip2";
Dir::Bin::xz "/usr/bin/xz";
Dir::Media "";
Dir::Media::MountPath "/media/apt";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Acquire "";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom/";
Acquire::http "";
Acquire::http::Proxy "http://localhost:3142";;
Acquire::Pdiffs "false";
Acquire::Languages "";
Acquire::Languages:: "en";
Acquire::Languages:: "none";
Unattended-Upgrade "";
Unattended-Upgrade::Origins-Pattern "";
Unattended-Upgrade::Origins-Pattern::
"origin=Debian,archive=stable,label=Debian-Security";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
CommandLine "";
CommandLine::AsString "apt-config dump";

-- (no /etc/apt/preferences present) --


-- /etc/apt/sources.list --

deb [trusted=yes] file:///home/smcv/tmp/out/2.apt foo main

-- System Information:
Debian Release: 7.4
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt depends on:
ii  debian-archive-keyring  2012.4
ii  gnupg                   1.4.12-7+deb7u3
ii  libapt-pkg4.12          0.9.7.9+deb7u1
ii  libc6                   2.13-38+deb7u1
ii  libgcc1                 1:4.7.2-5
ii  libstdc++6              4.7.2-5

apt recommends no packages.

Versions of packages apt suggests:
pn  apt-doc     <none>
ii  aptitude    0.6.8.2-1
ii  dpkg-dev    1.16.12
ii  python-apt  0.8.8.2
ii  xz-utils    5.1.1alpha+20120614-2

-- no debconf information
Origin: my archive
Label: my label
Suite: inadvisable
Codename: foo
Version: 1.0
Architectures: amd64 i386
Components: main
Source: foo
Section: misc
Priority: optional
Maintainer: me <me@example.com>
Package: foo-driver
Architecture: @ARCH@
Version: @VERSION@
Depends: libfoo (= @VERSION@)
Recommends: libgl1-foo-glx (= @VERSION@)
Breaks: libgl1-foo-glx (<< @VERSION@),
        libgl1-foo-glx (>> @VERSION@)
Description: dummy package analogous to fglrx-driver
Source: foo
Section: misc
Priority: optional
Maintainer: me <me@example.com>
Package: libfoo
Multi-Arch: same
Architecture: @ARCH@
Version: @VERSION@
Description: dummy package analogous to libfglrx
Source: foo
Section: misc
Priority: optional
Maintainer: me <me@example.com>
Package: libgl1-foo-glx
Multi-Arch: same
Architecture: @ARCH@
Version: @VERSION@
Depends: libfoo (= @VERSION@)
Description: dummy package analogous to libgl1-fglrx-glx
all:

test_apt_in_chroot:
	test -e /etc/debian_chroot
	sudo eatmydata apt-get update
	sudo eatmydata apt-get dist-upgrade
	sudo eatmydata apt-get install unattended-upgrades
	sudo dpkg --add-architecture i386
	sudo eatmydata dpkg -i \
		out/1.apt/pool/main/f/foo/foo-driver_1_amd64.deb \
		out/1.apt/pool/main/f/foo/lib*_1_*.deb
	echo "deb [trusted=yes] file://$(CURDIR)/out/2.apt foo main" | \
		sudo tee /etc/apt/sources.list
	sudo eatmydata apt-get update
	sudo eatmydata apt-get upgrade

test_uu_in_chroot:
	test -e /etc/debian_chroot
	sudo eatmydata apt-get update
	sudo eatmydata apt-get dist-upgrade
	sudo eatmydata apt-get install unattended-upgrades
	sudo dpkg --add-architecture i386
	sudo eatmydata dpkg -i \
		out/1.apt/pool/main/f/foo/foo-driver_1_amd64.deb \
		out/1.apt/pool/main/f/foo/lib*_1_*.deb
	echo "deb [trusted=yes] file://$(CURDIR)/out/2.apt foo main" | \
		sudo tee /etc/apt/sources.list
	printf 'Unattended-Upgrade::Origins-Pattern {\n"a=inadvisable";\n};\n' | \
		sudo tee /etc/apt/apt.conf.d/50unattended-upgrades
	sudo eatmydata apt-get update
	sudo unattended-upgrade --debug --minimal_upgrade_steps
	set -e && for x in /var/log/unattended-upgrades/*; do echo "=== $$x ==="; cat "$$x"; done

control_in := $(wildcard *.control.in)
control := \
	$(patsubst %.control.in,tmp/%_1_amd64/DEBIAN/control,$(control_in)) \
	$(patsubst %.control.in,tmp/%_2_amd64/DEBIAN/control,$(control_in)) \
	$(patsubst %.control.in,tmp/%_1_i386/DEBIAN/control,$(control_in)) \
	$(patsubst %.control.in,tmp/%_2_i386/DEBIAN/control,$(control_in)) \
	$(NULL)
debs := $(patsubst %/DEBIAN/control,%.deb,$(control))

all: out/1.apt out/2.apt

out/%.apt: $(debs) distributions
	install -d $@/conf
	install -m644 distributions $@/conf/distributions
	reprepro -b $@ includedeb foo tmp/*_$(*)_amd64.deb tmp/*_$(*)_i386.deb

clean:
	rm -fr out tmp

$(debs): tmp/%.deb: tmp/%/DEBIAN/control
	dpkg-deb -b tmp/$*

tmp/%_1_amd64/DEBIAN/control: %.control.in
	install -d $(dir $@)
	sed -e 's/@VERSION@/1/' -e 's/@ARCH@/amd64/' < $< > $@

tmp/%_1_i386/DEBIAN/control: %.control.in
	install -d $(dir $@)
	sed -e 's/@VERSION@/1/' -e 's/@ARCH@/i386/' < $< > $@

tmp/%_2_amd64/DEBIAN/control: %.control.in
	install -d $(dir $@)
	sed -e 's/@VERSION@/2/' -e 's/@ARCH@/amd64/' < $< > $@

tmp/%_2_i386/DEBIAN/control: %.control.in
	install -d $(dir $@)
	sed -e 's/@VERSION@/2/' -e 's/@ARCH@/i386/' < $< > $@

Reply to: