Is it possible to package programs from apt?

I have been using snapcraft to automate my apps installation, which uses scripts with apt, wget, git, pip etc. How should I include all those programs to my snap, or use the host’s (except for apt, of course) ?The only files currently on the snap are shell and python scripts, since the installation process downloads a ~12 GB tar.gz that needs to be extracted and built.

I’m new to containerizing apps, so could you guys also point out things I’m doing wrong?

You can use stage-packages to include packages right from the ubuntu repos.

I tried using stage-packages but they don’t seem to be included in the final snap. Actually, I can not find them in /usr/bin or /bin, are they installed somewhere else?

yes, they go into /snap/<snapname>/current/ …

Sorry, correct me if I am wrong, but I meant relative to the container. For example, a install hook or a script running inside the snap.

nope … you would have to add an apps entry for each command you want to expose to the outside world …

I don’t mean to make them available outside of my snap, but thanks anyway. I found them in the PATH.

right, they are automatically added to your PATH for any app running inside the snap confinement …

1 Like