Package repository

How do I add or remove package repositories to a snapcraft.yaml ?

For example I want to add a package found in /var/lib/apt/lists/mx.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-amd64_Packages

but is not in the bionic universe ?

The current package I am struggling with is libpng16-devtools.

Thank you.

either build with

base: core

to build your snap against 16.04 (which still has the old naming scheme for that package (libpng16-devtools))

or build with

base: core18

and simply use the new name for the package which is libpng-tools in your stage-packages: or build-packages: (wherever you use -devtools today)

I am actually using core18, but the software I am packaging appears to want that particular package. How do I specify other repos for packages to be pulled from ?

I am specifying packages in “stage-packages:”
and wanted to just add this one. I was hoping there was a keyword to add package repositories.

while you can indeed add PPAs (there are various posts in the forum that the search function should reveal about how to do that), why not simply use the lib under its new name ? afaik the content didnt change drastically, it was just renamed from libpng16-devtools to libpng-tools, just use that in your stage-packages: entry, that should give you the runtime lib as needed.

in general you cant/should not really mix different distro or release archives, apt wont be happy about it … and even if you get it to work somehow by cheating the system and hacking around issues it is likely that you introduce instabilities, thats the drawback of dpkg/apt …