Automatically install unmet build dependencies as detected by dpkg-checkbuilddeps












3















Is there a command that installs all the unmet build dependencies that dpkg-checkbuilddeps would list?



I tried to sed the output and give it to apt-get install, but it seems very hacky and for some reason didn't work in some environments.



sudo apt-get install --yes $(dpkg-checkbuilddeps | sed 's/([^)]*)//g' | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies://g')


Is there a better way?










share|improve this question





























    3















    Is there a command that installs all the unmet build dependencies that dpkg-checkbuilddeps would list?



    I tried to sed the output and give it to apt-get install, but it seems very hacky and for some reason didn't work in some environments.



    sudo apt-get install --yes $(dpkg-checkbuilddeps | sed 's/([^)]*)//g' | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies://g')


    Is there a better way?










    share|improve this question



























      3












      3








      3


      2






      Is there a command that installs all the unmet build dependencies that dpkg-checkbuilddeps would list?



      I tried to sed the output and give it to apt-get install, but it seems very hacky and for some reason didn't work in some environments.



      sudo apt-get install --yes $(dpkg-checkbuilddeps | sed 's/([^)]*)//g' | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies://g')


      Is there a better way?










      share|improve this question
















      Is there a command that installs all the unmet build dependencies that dpkg-checkbuilddeps would list?



      I tried to sed the output and give it to apt-get install, but it seems very hacky and for some reason didn't work in some environments.



      sudo apt-get install --yes $(dpkg-checkbuilddeps | sed 's/([^)]*)//g' | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies://g')


      Is there a better way?







      debian apt dpkg dependencies






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 26 at 13:25









      Stephen Kitt

      170k24383460




      170k24383460










      asked Jan 11 '18 at 21:44









      ForivinForivin

      205215




      205215






















          2 Answers
          2






          active

          oldest

          votes


















          8














          I use mk-build-deps from the devscripts package for this (you’ll also need equivs).



          mk-build-deps debian/control


          will build a package depending on all the build-dependencies in the given control file; that package can then be installed using apt, which will also install all the missing dependencies.



          The advantage of this approach is that uninstalling the dependency package, once you’ve finished with it, will also identify any build-dependencies which could also be uninstalled.






          share|improve this answer

































            0














            Try the following:



            dpkg-checkbuilddeps 2>&1 | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies: //g' | sed 's/[(][^)]*[)] //g'


            First of all, dpkg-checkbuilddeps prints out the error to stderr not stdout. So it needs to be redirected to stdout to use pipeline.



            Here is how to Redirect stderr and stdout in Bash



            You used the regex ([^)]*) on:



            sed 's/([^)]*)//g'


            But it should be:



            sed 's/[(][^)]*[)] //g'


            Reference: Using sed to delete a string between parentheses






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              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: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              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%2funix.stackexchange.com%2fquestions%2f416457%2fautomatically-install-unmet-build-dependencies-as-detected-by-dpkg-checkbuilddep%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









              8














              I use mk-build-deps from the devscripts package for this (you’ll also need equivs).



              mk-build-deps debian/control


              will build a package depending on all the build-dependencies in the given control file; that package can then be installed using apt, which will also install all the missing dependencies.



              The advantage of this approach is that uninstalling the dependency package, once you’ve finished with it, will also identify any build-dependencies which could also be uninstalled.






              share|improve this answer






























                8














                I use mk-build-deps from the devscripts package for this (you’ll also need equivs).



                mk-build-deps debian/control


                will build a package depending on all the build-dependencies in the given control file; that package can then be installed using apt, which will also install all the missing dependencies.



                The advantage of this approach is that uninstalling the dependency package, once you’ve finished with it, will also identify any build-dependencies which could also be uninstalled.






                share|improve this answer




























                  8












                  8








                  8







                  I use mk-build-deps from the devscripts package for this (you’ll also need equivs).



                  mk-build-deps debian/control


                  will build a package depending on all the build-dependencies in the given control file; that package can then be installed using apt, which will also install all the missing dependencies.



                  The advantage of this approach is that uninstalling the dependency package, once you’ve finished with it, will also identify any build-dependencies which could also be uninstalled.






                  share|improve this answer















                  I use mk-build-deps from the devscripts package for this (you’ll also need equivs).



                  mk-build-deps debian/control


                  will build a package depending on all the build-dependencies in the given control file; that package can then be installed using apt, which will also install all the missing dependencies.



                  The advantage of this approach is that uninstalling the dependency package, once you’ve finished with it, will also identify any build-dependencies which could also be uninstalled.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 26 at 13:25

























                  answered Jan 12 '18 at 6:28









                  Stephen KittStephen Kitt

                  170k24383460




                  170k24383460

























                      0














                      Try the following:



                      dpkg-checkbuilddeps 2>&1 | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies: //g' | sed 's/[(][^)]*[)] //g'


                      First of all, dpkg-checkbuilddeps prints out the error to stderr not stdout. So it needs to be redirected to stdout to use pipeline.



                      Here is how to Redirect stderr and stdout in Bash



                      You used the regex ([^)]*) on:



                      sed 's/([^)]*)//g'


                      But it should be:



                      sed 's/[(][^)]*[)] //g'


                      Reference: Using sed to delete a string between parentheses






                      share|improve this answer






























                        0














                        Try the following:



                        dpkg-checkbuilddeps 2>&1 | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies: //g' | sed 's/[(][^)]*[)] //g'


                        First of all, dpkg-checkbuilddeps prints out the error to stderr not stdout. So it needs to be redirected to stdout to use pipeline.



                        Here is how to Redirect stderr and stdout in Bash



                        You used the regex ([^)]*) on:



                        sed 's/([^)]*)//g'


                        But it should be:



                        sed 's/[(][^)]*[)] //g'


                        Reference: Using sed to delete a string between parentheses






                        share|improve this answer




























                          0












                          0








                          0







                          Try the following:



                          dpkg-checkbuilddeps 2>&1 | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies: //g' | sed 's/[(][^)]*[)] //g'


                          First of all, dpkg-checkbuilddeps prints out the error to stderr not stdout. So it needs to be redirected to stdout to use pipeline.



                          Here is how to Redirect stderr and stdout in Bash



                          You used the regex ([^)]*) on:



                          sed 's/([^)]*)//g'


                          But it should be:



                          sed 's/[(][^)]*[)] //g'


                          Reference: Using sed to delete a string between parentheses






                          share|improve this answer















                          Try the following:



                          dpkg-checkbuilddeps 2>&1 | sed 's/dpkg-checkbuilddeps:serror:sUnmet build dependencies: //g' | sed 's/[(][^)]*[)] //g'


                          First of all, dpkg-checkbuilddeps prints out the error to stderr not stdout. So it needs to be redirected to stdout to use pipeline.



                          Here is how to Redirect stderr and stdout in Bash



                          You used the regex ([^)]*) on:



                          sed 's/([^)]*)//g'


                          But it should be:



                          sed 's/[(][^)]*[)] //g'


                          Reference: Using sed to delete a string between parentheses







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jan 31 '18 at 10:09









                          galoget

                          35729




                          35729










                          answered Jan 31 '18 at 7:21









                          argenhongargenhong

                          1




                          1






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • 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%2funix.stackexchange.com%2fquestions%2f416457%2fautomatically-install-unmet-build-dependencies-as-detected-by-dpkg-checkbuilddep%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

                              How to make a Squid Proxy server?

                              Is this a new Fibonacci Identity?

                              19世紀