Let’s say you have this long list of libraries to put into the stage-packages
:
Files from the build host were migrated into the snap to satisfy dependencies that would otherwise not be met. This feature will be removed in a future release. If these libraries are needed in the final snap, ensure that the following are either satisfied by a stage-packages entry or through a part:
usr/lib/x86_64-linux-gnu/libICE.so.6
usr/lib/x86_64-linux-gnu/libSM.so.6
usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
usr/lib/x86_64-linux-gnu/libX11.so.6
usr/lib/x86_64-linux-gnu/libXau.so.6
usr/lib/x86_64-linux-gnu/libXcomposite.so.1
usr/lib/x86_64-linux-gnu/libXcursor.so.1
usr/lib/x86_64-linux-gnu/libXdamage.so.1
usr/lib/x86_64-linux-gnu/libXdmcp.so.6
usr/lib/x86_64-linux-gnu/libXext.so.6
usr/lib/x86_64-linux-gnu/libXfixes.so.3
usr/lib/x86_64-linux-gnu/libXi.so.6
usr/lib/x86_64-linux-gnu/libXinerama.so.1
usr/lib/x86_64-linux-gnu/libXrandr.so.2
usr/lib/x86_64-linux-gnu/libXrender.so.1
usr/lib/x86_64-linux-gnu/libXxf86vm.so.1
usr/lib/x86_64-linux-gnu/libatk-1.0.so.0
usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
usr/lib/x86_64-linux-gnu/libatspi.so.0
usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0
usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0
usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2
usr/lib/x86_64-linux-gnu/libcairo.so.2
usr/lib/x86_64-linux-gnu/libcapnp-0.5.3.so
usr/lib/x86_64-linux-gnu/libdatrie.so.1
usr/lib/x86_64-linux-gnu/libdrm.so.2
usr/lib/x86_64-linux-gnu/libenchant.so.1
usr/lib/x86_64-linux-gnu/libepoxy.so.0
usr/lib/x86_64-linux-gnu/libfontconfig.so.1
usr/lib/x86_64-linux-gnu/libgbm.so.1
usr/lib/x86_64-linux-gnu/libgdk-3.so.0
usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
usr/lib/x86_64-linux-gnu/libglapi.so.0
usr/lib/x86_64-linux-gnu/libgraphite2.so.3
usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0
usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so.0
usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0
usr/lib/x86_64-linux-gnu/libgstfft-1.0.so.0
usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so.0
usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
usr/lib/x86_64-linux-gnu/libgsttag-1.0.so.0
usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
usr/lib/x86_64-linux-gnu/libgtk-3.so.0
usr/lib/x86_64-linux-gnu/libharfbuzz-icu.so.0
usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
usr/lib/x86_64-linux-gnu/libhyphen.so.0
usr/lib/x86_64-linux-gnu/libicudata.so.55
usr/lib/x86_64-linux-gnu/libicui18n.so.55
usr/lib/x86_64-linux-gnu/libicuuc.so.55
usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18
usr/lib/x86_64-linux-gnu/libjbig.so.0
usr/lib/x86_64-linux-gnu/libjpeg.so.8
usr/lib/x86_64-linux-gnu/libkj-0.5.3.so
usr/lib/x86_64-linux-gnu/libmirclient.so.9
usr/lib/x86_64-linux-gnu/libmircommon.so.7
usr/lib/x86_64-linux-gnu/libmircore.so.1
usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3
usr/lib/x86_64-linux-gnu/libnotify.so.4
usr/lib/x86_64-linux-gnu/liborc-0.4.so.0
usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
usr/lib/x86_64-linux-gnu/libpixman-1.so.0
usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9
usr/lib/x86_64-linux-gnu/libsecret-1.so.0
usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1
usr/lib/x86_64-linux-gnu/libthai.so.0
usr/lib/x86_64-linux-gnu/libtiff.so.5
usr/lib/x86_64-linux-gnu/libwayland-client.so.0
usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0
usr/lib/x86_64-linux-gnu/libwayland-egl.so.1
usr/lib/x86_64-linux-gnu/libwayland-server.so.0
usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37
usr/lib/x86_64-linux-gnu/libwebp.so.5
usr/lib/x86_64-linux-gnu/libwebpdemux.so.1
usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0
usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0
usr/lib/x86_64-linux-gnu/libxcb-glx.so.0
usr/lib/x86_64-linux-gnu/libxcb-present.so.0
usr/lib/x86_64-linux-gnu/libxcb-render.so.0
usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
usr/lib/x86_64-linux-gnu/libxcb-sync.so.1
usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0
usr/lib/x86_64-linux-gnu/libxcb.so.1
usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
usr/lib/x86_64-linux-gnu/libxml2.so.2
usr/lib/x86_64-linux-gnu/libxshmfence.so.1
usr/lib/x86_64-linux-gnu/libxslt.so.1
usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1
usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
Searching them one-by-one on the Ubuntu Packages Search? Nope.
Method 1: Scripting
-
Copy the file list (without the prompt line) and save it as, for example,
missing-libraries.txt
-
On the build host/container/VM’s shell, run:
cut \ --delimiter=':' \ --fields=1 \ <<< "$( while read -r library_file; do dpkg-query --search "${library_file}" done <missing-libraries.txt )" \ | env LANG=C sort \ | uniq \ | sed --regexp-extended 's/^(.*)$/- \1/' \ > missing-stage-packages.yaml
-
Open the created
missing-stage-packages.yaml
file and voila!- libatk-bridge2.0-0 - libatk1.0-0 - libatspi2.0-0 - libboost-filesystem1.58.0 - libboost-system1.58.0 - libcairo-gobject2 - libcairo2 - libcapnp-0.5.3 - libdatrie1 - libdrm2 - libegl1-mesa - libenchant1c2a - libepoxy0 - libfontconfig1 - libgbm1 - libgdk-pixbuf2.0-0 - libglapi-mesa - libgraphite2-3 - libgstreamer-plugins-base1.0-0 - libgstreamer1.0-0 - libgtk-3-0 - libharfbuzz-icu0 - libharfbuzz0b - libhyphen0 - libice6 - libicu55 - libjavascriptcoregtk-4.0-18 - libjbig0 - libjpeg-turbo8 - libmirclient9 - libmircommon7 - libmircore1 - libmirprotobuf3 - libnotify4 - liborc-0.4-0 - libpango-1.0-0 - libpangocairo-1.0-0 - libpangoft2-1.0-0 - libpixman-1-0 - libprotobuf-lite9v5 - libsecret-1-0 - libsm6 - libsoup2.4-1 - libthai0 - libtiff5 - libwayland-client0 - libwayland-cursor0 - libwayland-egl1-mesa - libwayland-server0 - libwebkit2gtk-4.0-37 - libwebp5 - libwebpdemux1 - libx11-6 - libx11-xcb1 - libxau6 - libxcb-dri2-0 - libxcb-dri3-0 - libxcb-glx0 - libxcb-present0 - libxcb-render0 - libxcb-shm0 - libxcb-sync1 - libxcb-xfixes0 - libxcb1 - libxcomposite1 - libxcursor1 - libxdamage1 - libxdmcp6 - libxext6 - libxfixes3 - libxi6 - libxinerama1 - libxkbcommon0 - libxml2 - libxrandr2 - libxrender1 - libxshmfence1 - libxslt1.1 - libxxf86vm1
all the
stage-packages
entries ready to be pasted to your part’s definition.
This topic is a wiki, new tricks welcome.