Check if multiple dependencies exist before installing a package in Debian or Ubuntu

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
8
down vote

favorite
1












I already know that I can check if multiple dependencies required to install a package in Debian or Ubuntu exist in my repositories by running the following command:



apt policy first-package second-package ... last-package 


This command also tells me if I have each package currently installed or not.



My question is how to quickly check if multiple dependency packages exist in a supported version of Debian or Ubuntu that I do not currently have installed. Because I do not have that OS currently installed I can't check if the dependency packages exist locally and offline, but I want to check if the required dependency packages exist in the default repositories from the terminal.



One possible use for this information is to check if an application that is installed in Ubuntu can also be installed in the latest version of Ubuntu before installing the latest version of Ubuntu or upgrading the existing OS to the latest version.







share|improve this question

























    up vote
    8
    down vote

    favorite
    1












    I already know that I can check if multiple dependencies required to install a package in Debian or Ubuntu exist in my repositories by running the following command:



    apt policy first-package second-package ... last-package 


    This command also tells me if I have each package currently installed or not.



    My question is how to quickly check if multiple dependency packages exist in a supported version of Debian or Ubuntu that I do not currently have installed. Because I do not have that OS currently installed I can't check if the dependency packages exist locally and offline, but I want to check if the required dependency packages exist in the default repositories from the terminal.



    One possible use for this information is to check if an application that is installed in Ubuntu can also be installed in the latest version of Ubuntu before installing the latest version of Ubuntu or upgrading the existing OS to the latest version.







    share|improve this question























      up vote
      8
      down vote

      favorite
      1









      up vote
      8
      down vote

      favorite
      1






      1





      I already know that I can check if multiple dependencies required to install a package in Debian or Ubuntu exist in my repositories by running the following command:



      apt policy first-package second-package ... last-package 


      This command also tells me if I have each package currently installed or not.



      My question is how to quickly check if multiple dependency packages exist in a supported version of Debian or Ubuntu that I do not currently have installed. Because I do not have that OS currently installed I can't check if the dependency packages exist locally and offline, but I want to check if the required dependency packages exist in the default repositories from the terminal.



      One possible use for this information is to check if an application that is installed in Ubuntu can also be installed in the latest version of Ubuntu before installing the latest version of Ubuntu or upgrading the existing OS to the latest version.







      share|improve this question













      I already know that I can check if multiple dependencies required to install a package in Debian or Ubuntu exist in my repositories by running the following command:



      apt policy first-package second-package ... last-package 


      This command also tells me if I have each package currently installed or not.



      My question is how to quickly check if multiple dependency packages exist in a supported version of Debian or Ubuntu that I do not currently have installed. Because I do not have that OS currently installed I can't check if the dependency packages exist locally and offline, but I want to check if the required dependency packages exist in the default repositories from the terminal.



      One possible use for this information is to check if an application that is installed in Ubuntu can also be installed in the latest version of Ubuntu before installing the latest version of Ubuntu or upgrading the existing OS to the latest version.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Apr 29 at 11:54
























      asked Apr 29 at 8:56









      karel

      704817




      704817




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          10
          down vote



          accepted










          The ideal tool for this is rmadison, which is a simple Perl script with few dependencies (the URI module and wget or curl), so it can run pretty much everywhere. It interrogates the Madison services hosted by Debian and Ubuntu to determine the availability of packages:



          rmadison gcc-7


          tells you which versions of GCC 7 are available in the various Debian suites,



          rmadison -u ubuntu gcc-7


          does the same for Ubuntu.



          You can restrict the output to a specific version:



          rmadison -u ubuntu -s bionic gcc-7





          share|improve this answer





















          • @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
            – GnP
            Apr 29 at 13:26










          • You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
            – karel
            Apr 29 at 13:48


















          up vote
          3
          down vote













          rmadison can search for both Debian and Ubuntu packages at the same time, and it also searches for packages in both End Of Life (12.04) and unreleased (18.10) Ubuntu versions. These are great features, but rmadison can't do partial keyword searching on my computer. Sometimes I can't remember the whole package name that I am searching for. I can only remember part of it, and the following instructions also work in this situation. Otherwise use rmadison which can be installed by the command sudo apt-get install devscripts in Ubuntu and Debian.




          1. Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:



            #!/bin/bash
            while read line; do
            firefox --new-tab "https://packages.ubuntu.com/$line"
            done < packages.txt



          2. Make the script executable.



            chmod +x Open-multiple-URLs-in-Firefox.sh


          3. Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.



          4. Run the script.



            ./Open-multiple-URLs-in-Firefox.sh 


          The webpage that has information about each required dependency package will open in a separate tab in Firefox.



          In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=




          This command is simpler alternative to the above shell script for use when you are only searching for 1 or 2 packages.



          firefox --new-tab https://packages.ubuntu.com/first-package https://packages.ubuntu.com/next-package https://packages.ubuntu.com/last-package





          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f440698%2fcheck-if-multiple-dependencies-exist-before-installing-a-package-in-debian-or-ub%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            10
            down vote



            accepted










            The ideal tool for this is rmadison, which is a simple Perl script with few dependencies (the URI module and wget or curl), so it can run pretty much everywhere. It interrogates the Madison services hosted by Debian and Ubuntu to determine the availability of packages:



            rmadison gcc-7


            tells you which versions of GCC 7 are available in the various Debian suites,



            rmadison -u ubuntu gcc-7


            does the same for Ubuntu.



            You can restrict the output to a specific version:



            rmadison -u ubuntu -s bionic gcc-7





            share|improve this answer





















            • @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
              – GnP
              Apr 29 at 13:26










            • You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
              – karel
              Apr 29 at 13:48















            up vote
            10
            down vote



            accepted










            The ideal tool for this is rmadison, which is a simple Perl script with few dependencies (the URI module and wget or curl), so it can run pretty much everywhere. It interrogates the Madison services hosted by Debian and Ubuntu to determine the availability of packages:



            rmadison gcc-7


            tells you which versions of GCC 7 are available in the various Debian suites,



            rmadison -u ubuntu gcc-7


            does the same for Ubuntu.



            You can restrict the output to a specific version:



            rmadison -u ubuntu -s bionic gcc-7





            share|improve this answer





















            • @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
              – GnP
              Apr 29 at 13:26










            • You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
              – karel
              Apr 29 at 13:48













            up vote
            10
            down vote



            accepted







            up vote
            10
            down vote



            accepted






            The ideal tool for this is rmadison, which is a simple Perl script with few dependencies (the URI module and wget or curl), so it can run pretty much everywhere. It interrogates the Madison services hosted by Debian and Ubuntu to determine the availability of packages:



            rmadison gcc-7


            tells you which versions of GCC 7 are available in the various Debian suites,



            rmadison -u ubuntu gcc-7


            does the same for Ubuntu.



            You can restrict the output to a specific version:



            rmadison -u ubuntu -s bionic gcc-7





            share|improve this answer













            The ideal tool for this is rmadison, which is a simple Perl script with few dependencies (the URI module and wget or curl), so it can run pretty much everywhere. It interrogates the Madison services hosted by Debian and Ubuntu to determine the availability of packages:



            rmadison gcc-7


            tells you which versions of GCC 7 are available in the various Debian suites,



            rmadison -u ubuntu gcc-7


            does the same for Ubuntu.



            You can restrict the output to a specific version:



            rmadison -u ubuntu -s bionic gcc-7






            share|improve this answer













            share|improve this answer



            share|improve this answer











            answered Apr 29 at 12:42









            Stephen Kitt

            140k22302363




            140k22302363











            • @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
              – GnP
              Apr 29 at 13:26










            • You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
              – karel
              Apr 29 at 13:48

















            • @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
              – GnP
              Apr 29 at 13:26










            • You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
              – karel
              Apr 29 at 13:48
















            @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
            – GnP
            Apr 29 at 13:26




            @karel notice that the parameter after -u is not a package name, but a distro (or probably repo) name
            – GnP
            Apr 29 at 13:26












            You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
            – karel
            Apr 29 at 13:48





            You're right, it was the missing ubuntu and it does work on my example file. In fact it works better than my script because it also returns results for packages for precise which is an end of life release.
            – karel
            Apr 29 at 13:48













            up vote
            3
            down vote













            rmadison can search for both Debian and Ubuntu packages at the same time, and it also searches for packages in both End Of Life (12.04) and unreleased (18.10) Ubuntu versions. These are great features, but rmadison can't do partial keyword searching on my computer. Sometimes I can't remember the whole package name that I am searching for. I can only remember part of it, and the following instructions also work in this situation. Otherwise use rmadison which can be installed by the command sudo apt-get install devscripts in Ubuntu and Debian.




            1. Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:



              #!/bin/bash
              while read line; do
              firefox --new-tab "https://packages.ubuntu.com/$line"
              done < packages.txt



            2. Make the script executable.



              chmod +x Open-multiple-URLs-in-Firefox.sh


            3. Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.



            4. Run the script.



              ./Open-multiple-URLs-in-Firefox.sh 


            The webpage that has information about each required dependency package will open in a separate tab in Firefox.



            In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=




            This command is simpler alternative to the above shell script for use when you are only searching for 1 or 2 packages.



            firefox --new-tab https://packages.ubuntu.com/first-package https://packages.ubuntu.com/next-package https://packages.ubuntu.com/last-package





            share|improve this answer



























              up vote
              3
              down vote













              rmadison can search for both Debian and Ubuntu packages at the same time, and it also searches for packages in both End Of Life (12.04) and unreleased (18.10) Ubuntu versions. These are great features, but rmadison can't do partial keyword searching on my computer. Sometimes I can't remember the whole package name that I am searching for. I can only remember part of it, and the following instructions also work in this situation. Otherwise use rmadison which can be installed by the command sudo apt-get install devscripts in Ubuntu and Debian.




              1. Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:



                #!/bin/bash
                while read line; do
                firefox --new-tab "https://packages.ubuntu.com/$line"
                done < packages.txt



              2. Make the script executable.



                chmod +x Open-multiple-URLs-in-Firefox.sh


              3. Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.



              4. Run the script.



                ./Open-multiple-URLs-in-Firefox.sh 


              The webpage that has information about each required dependency package will open in a separate tab in Firefox.



              In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=




              This command is simpler alternative to the above shell script for use when you are only searching for 1 or 2 packages.



              firefox --new-tab https://packages.ubuntu.com/first-package https://packages.ubuntu.com/next-package https://packages.ubuntu.com/last-package





              share|improve this answer

























                up vote
                3
                down vote










                up vote
                3
                down vote









                rmadison can search for both Debian and Ubuntu packages at the same time, and it also searches for packages in both End Of Life (12.04) and unreleased (18.10) Ubuntu versions. These are great features, but rmadison can't do partial keyword searching on my computer. Sometimes I can't remember the whole package name that I am searching for. I can only remember part of it, and the following instructions also work in this situation. Otherwise use rmadison which can be installed by the command sudo apt-get install devscripts in Ubuntu and Debian.




                1. Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:



                  #!/bin/bash
                  while read line; do
                  firefox --new-tab "https://packages.ubuntu.com/$line"
                  done < packages.txt



                2. Make the script executable.



                  chmod +x Open-multiple-URLs-in-Firefox.sh


                3. Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.



                4. Run the script.



                  ./Open-multiple-URLs-in-Firefox.sh 


                The webpage that has information about each required dependency package will open in a separate tab in Firefox.



                In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=




                This command is simpler alternative to the above shell script for use when you are only searching for 1 or 2 packages.



                firefox --new-tab https://packages.ubuntu.com/first-package https://packages.ubuntu.com/next-package https://packages.ubuntu.com/last-package





                share|improve this answer















                rmadison can search for both Debian and Ubuntu packages at the same time, and it also searches for packages in both End Of Life (12.04) and unreleased (18.10) Ubuntu versions. These are great features, but rmadison can't do partial keyword searching on my computer. Sometimes I can't remember the whole package name that I am searching for. I can only remember part of it, and the following instructions also work in this situation. Otherwise use rmadison which can be installed by the command sudo apt-get install devscripts in Ubuntu and Debian.




                1. Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:



                  #!/bin/bash
                  while read line; do
                  firefox --new-tab "https://packages.ubuntu.com/$line"
                  done < packages.txt



                2. Make the script executable.



                  chmod +x Open-multiple-URLs-in-Firefox.sh


                3. Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.



                4. Run the script.



                  ./Open-multiple-URLs-in-Firefox.sh 


                The webpage that has information about each required dependency package will open in a separate tab in Firefox.



                In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=




                This command is simpler alternative to the above shell script for use when you are only searching for 1 or 2 packages.



                firefox --new-tab https://packages.ubuntu.com/first-package https://packages.ubuntu.com/next-package https://packages.ubuntu.com/last-package






                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited Jun 3 at 0:43


























                answered Apr 29 at 9:17









                karel

                704817




                704817






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440698%2fcheck-if-multiple-dependencies-exist-before-installing-a-package-in-debian-or-ub%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?