Can a snap be built in a way such as, when the user tries to install it, the snap also installs another package? For example,
The short answer to your question is: no, snaps cannot depend upon .debs in such as way that, when the snap is installed, the .deb is installed as well.
However, the longer answer is that, when building the snap, you can bundle whatever .debs you want within it. To use your example, here's the snapcraft.yaml for a snap that bundles wget within it:
name: my-snap-name # you probably want to 'snapcraft register <name>' base: core18 # the base snap is the execution environment for this snap version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' summary: Single-line elevator pitch for your amazing snap # 79 char long summary description: | This is my-snap's description. You have a paragraph or two to tell the most important story about your snap. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the snap store. grade: devel # must be 'stable' to release into candidate/stable channels confinement: strict # 'strict' confinement means fully confined parts: my-part: plugin: nil # Include the wget .deb from the Ubuntu package archive stage-packages: [wget] apps: # expose wget to end-users wget: command: usr/bin/wget plugs: [network, home, removable-media]
snapcraft on that and you end up with a snap that has a
wget app. It doesn't pull wget in at install-time like you asked, but by pulling it in at build-time perhaps it accomplishes your end goal.
Snap packages are self contained and need no outside dependencies to run. See here for more information Linux Commando: Snaps