Snapcraft dpkg-query error on multiarch OS

Bug #1698888 reported by Paul Cercueil on 2017-06-19
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Medium
Unassigned

Bug Description

When building on a OS with multiarch enabled, and with the i686 and x86_64 versions of libc6 installed, Snapcraft will issue the following error:

dpkg-query: error: --listfiles needs a valid package name but 'libc6' is not: ambiguous package name 'libc6' with more than one installed instance

Use --help for help about querying packages.
Command '['dpkg', '-L', 'libc6']' returned non-zero exit status 2

Kyle Fazzari (kyrofa) wrote :

Thank you for this! Snapcraft should use a specific arch.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
Heikki Orsila (heikki-orsila) wrote :

This bug affects me as well. I was able to build a snap package with snapcraft for amd64 with the following hack:

1. mkdir dpkg-wrapper
2. create dpkg-wrapper/dpkg script:
#!/bin/bash

if [[ $1 = "-L" && $2 = "libc6" && $3 = "" ]] ; then
 exec /usr/bin/dpkg -L libc6:amd64
else
 exec /usr/bin/dpkg "$@"
fi

3. export PATH=$(pwd)/dpkg-wrapper:"${PATH}"
4. snapcraft ...

This hack is absolutely terrible, but it worked for me.

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

Other bug subscribers