can a snap package depend on a .deb package provided by the distro?












0















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, wget. Thanks.










share|improve this question



























    0















    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, wget. Thanks.










    share|improve this question

























      0












      0








      0








      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, wget. Thanks.










      share|improve this question














      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, wget. Thanks.







      apt package-management snap deb packaging






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      knocteknocte

      689820




      689820






















          2 Answers
          2






          active

          oldest

          votes


















          1














          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]


          Run 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.






          share|improve this answer
























          • thanks! this is for a binary, but what if I also need libs from usr/lib?

            – knocte
            2 days ago











          • for example: gtk2 libs?

            – knocte
            2 days ago











          • Same thing, just add it to stage-packages and they'll end up in the snap.

            – Kyle
            yesterday



















          0














          Snap packages are self contained and need no outside dependencies to run.
          See here for more information Linux Commando: Snaps






          share|improve this answer
























          • that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

            – knocte
            2 days ago






          • 2





            that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

            – kc1di
            2 days ago






          • 1





            A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

            – user535733
            2 days ago













          • This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

            – kc1di
            2 days ago











          • @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

            – knocte
            2 days ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113031%2fcan-a-snap-package-depend-on-a-deb-package-provided-by-the-distro%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          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]


          Run 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.






          share|improve this answer
























          • thanks! this is for a binary, but what if I also need libs from usr/lib?

            – knocte
            2 days ago











          • for example: gtk2 libs?

            – knocte
            2 days ago











          • Same thing, just add it to stage-packages and they'll end up in the snap.

            – Kyle
            yesterday
















          1














          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]


          Run 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.






          share|improve this answer
























          • thanks! this is for a binary, but what if I also need libs from usr/lib?

            – knocte
            2 days ago











          • for example: gtk2 libs?

            – knocte
            2 days ago











          • Same thing, just add it to stage-packages and they'll end up in the snap.

            – Kyle
            yesterday














          1












          1








          1







          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]


          Run 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.






          share|improve this answer













          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]


          Run 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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          KyleKyle

          4,2071319




          4,2071319













          • thanks! this is for a binary, but what if I also need libs from usr/lib?

            – knocte
            2 days ago











          • for example: gtk2 libs?

            – knocte
            2 days ago











          • Same thing, just add it to stage-packages and they'll end up in the snap.

            – Kyle
            yesterday



















          • thanks! this is for a binary, but what if I also need libs from usr/lib?

            – knocte
            2 days ago











          • for example: gtk2 libs?

            – knocte
            2 days ago











          • Same thing, just add it to stage-packages and they'll end up in the snap.

            – Kyle
            yesterday

















          thanks! this is for a binary, but what if I also need libs from usr/lib?

          – knocte
          2 days ago





          thanks! this is for a binary, but what if I also need libs from usr/lib?

          – knocte
          2 days ago













          for example: gtk2 libs?

          – knocte
          2 days ago





          for example: gtk2 libs?

          – knocte
          2 days ago













          Same thing, just add it to stage-packages and they'll end up in the snap.

          – Kyle
          yesterday





          Same thing, just add it to stage-packages and they'll end up in the snap.

          – Kyle
          yesterday













          0














          Snap packages are self contained and need no outside dependencies to run.
          See here for more information Linux Commando: Snaps






          share|improve this answer
























          • that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

            – knocte
            2 days ago






          • 2





            that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

            – kc1di
            2 days ago






          • 1





            A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

            – user535733
            2 days ago













          • This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

            – kc1di
            2 days ago











          • @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

            – knocte
            2 days ago
















          0














          Snap packages are self contained and need no outside dependencies to run.
          See here for more information Linux Commando: Snaps






          share|improve this answer
























          • that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

            – knocte
            2 days ago






          • 2





            that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

            – kc1di
            2 days ago






          • 1





            A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

            – user535733
            2 days ago













          • This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

            – kc1di
            2 days ago











          • @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

            – knocte
            2 days ago














          0












          0








          0







          Snap packages are self contained and need no outside dependencies to run.
          See here for more information Linux Commando: Snaps






          share|improve this answer













          Snap packages are self contained and need no outside dependencies to run.
          See here for more information Linux Commando: Snaps







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          kc1dikc1di

          744




          744













          • that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

            – knocte
            2 days ago






          • 2





            that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

            – kc1di
            2 days ago






          • 1





            A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

            – user535733
            2 days ago













          • This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

            – kc1di
            2 days ago











          • @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

            – knocte
            2 days ago



















          • that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

            – knocte
            2 days ago






          • 2





            that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

            – kc1di
            2 days ago






          • 1





            A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

            – user535733
            2 days ago













          • This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

            – kc1di
            2 days ago











          • @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

            – knocte
            2 days ago

















          that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

          – knocte
          2 days ago





          that guide is only written from the user point of view, not from the developer that wants to create the snap; I mean, I know that a snap can be self contained and include all dependencies inside, but if a .deb package already provides a version that is compatible with the app contained in the snap, and the snap builder decides it's good enough, can the snap depend on the .deb?

          – knocte
          2 days ago




          2




          2





          that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

          – kc1di
          2 days ago





          that may be true but the whole Idea of the snap is that it will work across many distros so if the developer require a dependency outside the snap that may not be the case because different distros may place files in different locations. JMHO.

          – kc1di
          2 days ago




          1




          1





          A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

          – user535733
          2 days ago







          A snap that depends upon a deb is non-portable, can be confusing to some users, and adds an unnecessary support burden to the developer. A more immediate problem is that snaps have no way to communicate a deb dependency to apt. This makes the install non-standard, and another pain point for support: We all know that humans sometimes aren't great at following simple directions.

          – user535733
          2 days ago















          This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

          – kc1di
          2 days ago





          This conical guide should answer your question more throughly : docs.snapcraft.io/the-snap-format/698

          – kc1di
          2 days ago













          @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

          – knocte
          2 days ago





          @user535733: ok even if it's non-portable, I'm aware of the disadvantage of this, how can I do it?

          – knocte
          2 days ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113031%2fcan-a-snap-package-depend-on-a-deb-package-provided-by-the-distro%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          數位音樂下載

          格利澤436b

          When can things happen in Etherscan, such as the picture below?