Install virtual package of specified version












1














There is a VCS repo that has 2 branches - master and release. There are also 2 Debian packages that are built from these branches - let's say foo for the release branch and foo-master for the master branch. In the Provides section they both have just foo



Package foo is of version 1.5, the other one is of version 1.6.
There is also another package, let's say bar, that depends on the package foo.



The problem is how to install the package bar with the latest version of the package foo. When I specify foo (<< 1.7) as a dependency of bar, it still installs foo of version 1.5. But if I rewrite it as foo (>= 1.6) it installs the latest version of foo.



Why does this happen?










share|improve this question
























  • Are you running apt-get install -t [reponame] foo=foo-1.6 to install foo?
    – kemotep
    Dec 18 at 15:24










  • @kemotep I'm trying to install this package indirectly, as a dependency of the package bar
    – Henry Barker
    Dec 19 at 9:09
















1














There is a VCS repo that has 2 branches - master and release. There are also 2 Debian packages that are built from these branches - let's say foo for the release branch and foo-master for the master branch. In the Provides section they both have just foo



Package foo is of version 1.5, the other one is of version 1.6.
There is also another package, let's say bar, that depends on the package foo.



The problem is how to install the package bar with the latest version of the package foo. When I specify foo (<< 1.7) as a dependency of bar, it still installs foo of version 1.5. But if I rewrite it as foo (>= 1.6) it installs the latest version of foo.



Why does this happen?










share|improve this question
























  • Are you running apt-get install -t [reponame] foo=foo-1.6 to install foo?
    – kemotep
    Dec 18 at 15:24










  • @kemotep I'm trying to install this package indirectly, as a dependency of the package bar
    – Henry Barker
    Dec 19 at 9:09














1












1








1


1





There is a VCS repo that has 2 branches - master and release. There are also 2 Debian packages that are built from these branches - let's say foo for the release branch and foo-master for the master branch. In the Provides section they both have just foo



Package foo is of version 1.5, the other one is of version 1.6.
There is also another package, let's say bar, that depends on the package foo.



The problem is how to install the package bar with the latest version of the package foo. When I specify foo (<< 1.7) as a dependency of bar, it still installs foo of version 1.5. But if I rewrite it as foo (>= 1.6) it installs the latest version of foo.



Why does this happen?










share|improve this question















There is a VCS repo that has 2 branches - master and release. There are also 2 Debian packages that are built from these branches - let's say foo for the release branch and foo-master for the master branch. In the Provides section they both have just foo



Package foo is of version 1.5, the other one is of version 1.6.
There is also another package, let's say bar, that depends on the package foo.



The problem is how to install the package bar with the latest version of the package foo. When I specify foo (<< 1.7) as a dependency of bar, it still installs foo of version 1.5. But if I rewrite it as foo (>= 1.6) it installs the latest version of foo.



Why does this happen?







debian apt package-management dependencies






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 18 at 11:25









Jeff Schaller

38.7k1053125




38.7k1053125










asked Dec 18 at 11:19









user327415

91




91












  • Are you running apt-get install -t [reponame] foo=foo-1.6 to install foo?
    – kemotep
    Dec 18 at 15:24










  • @kemotep I'm trying to install this package indirectly, as a dependency of the package bar
    – Henry Barker
    Dec 19 at 9:09


















  • Are you running apt-get install -t [reponame] foo=foo-1.6 to install foo?
    – kemotep
    Dec 18 at 15:24










  • @kemotep I'm trying to install this package indirectly, as a dependency of the package bar
    – Henry Barker
    Dec 19 at 9:09
















Are you running apt-get install -t [reponame] foo=foo-1.6 to install foo?
– kemotep
Dec 18 at 15:24




Are you running apt-get install -t [reponame] foo=foo-1.6 to install foo?
– kemotep
Dec 18 at 15:24












@kemotep I'm trying to install this package indirectly, as a dependency of the package bar
– Henry Barker
Dec 19 at 9:09




@kemotep I'm trying to install this package indirectly, as a dependency of the package bar
– Henry Barker
Dec 19 at 9:09










1 Answer
1






active

oldest

votes


















-1














So it goes without saying that this setup can potentially lead to FrankenDebian but if package bar and dependency foo are the only packages effected by this issue then there are methods to accomplish your goals.



Take a look at the Debian documentation concerning relationships between packages. You are going to need to modify the package bar to have it depend the version of package foo that you desire. I have found this post to Sever Fault that could help.



Rollback the installation of foo and bar (do not do this if it is going to cause further dependency issues!)



apt-get --purge remove foo bar


Verify how bar was packaged.



apt-cache showpkg bar


Under Dependencies: you can verify what version of foo is relevant to your version of bar. Now you can either grab bar with an apt-get download bar, apt-get install bar foo-, or wget the .deb straight from the repo to only get package bar.



Next following the steps in the post we need to edit the dependency relationship.





  • Unpack deb: ar x bar.deb


  • Unpack control archive: tar xzf control.tar.gz


  • Fix dependencies in control [In this case, changing Depends: foo (= 1.6)]


  • Repack control.tar.gz: tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control [Change the parts in the brackets as it applies to what was extracted]


  • Repack deb: ar rcs newbar.deb debian-binary control.tar.gz data.tar.gz [order very important here!]





Now complete the install of bar by issuing a apt-get -f install. It should now install the desired version of foo as a dependency.



Please consult with the package maintainers to see if they have reasons for skipping that version of foo. Another option would be to install the version of foo manually and installing bar from source. Again, verify that the dependency requirements have been changed.



You may also want to look into setting up and using APT-pinning for these packages to force apt to use only the version of a package that you want and make sure that the packages are sourced from the correct repo.



From here you should have installed bar with dependency foo-1.6 . Please comment if you have any questions or issues with this answer. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.



Best of Luck!






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%2f489663%2finstall-virtual-package-of-specified-version%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    -1














    So it goes without saying that this setup can potentially lead to FrankenDebian but if package bar and dependency foo are the only packages effected by this issue then there are methods to accomplish your goals.



    Take a look at the Debian documentation concerning relationships between packages. You are going to need to modify the package bar to have it depend the version of package foo that you desire. I have found this post to Sever Fault that could help.



    Rollback the installation of foo and bar (do not do this if it is going to cause further dependency issues!)



    apt-get --purge remove foo bar


    Verify how bar was packaged.



    apt-cache showpkg bar


    Under Dependencies: you can verify what version of foo is relevant to your version of bar. Now you can either grab bar with an apt-get download bar, apt-get install bar foo-, or wget the .deb straight from the repo to only get package bar.



    Next following the steps in the post we need to edit the dependency relationship.





    • Unpack deb: ar x bar.deb


    • Unpack control archive: tar xzf control.tar.gz


    • Fix dependencies in control [In this case, changing Depends: foo (= 1.6)]


    • Repack control.tar.gz: tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control [Change the parts in the brackets as it applies to what was extracted]


    • Repack deb: ar rcs newbar.deb debian-binary control.tar.gz data.tar.gz [order very important here!]





    Now complete the install of bar by issuing a apt-get -f install. It should now install the desired version of foo as a dependency.



    Please consult with the package maintainers to see if they have reasons for skipping that version of foo. Another option would be to install the version of foo manually and installing bar from source. Again, verify that the dependency requirements have been changed.



    You may also want to look into setting up and using APT-pinning for these packages to force apt to use only the version of a package that you want and make sure that the packages are sourced from the correct repo.



    From here you should have installed bar with dependency foo-1.6 . Please comment if you have any questions or issues with this answer. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.



    Best of Luck!






    share|improve this answer




























      -1














      So it goes without saying that this setup can potentially lead to FrankenDebian but if package bar and dependency foo are the only packages effected by this issue then there are methods to accomplish your goals.



      Take a look at the Debian documentation concerning relationships between packages. You are going to need to modify the package bar to have it depend the version of package foo that you desire. I have found this post to Sever Fault that could help.



      Rollback the installation of foo and bar (do not do this if it is going to cause further dependency issues!)



      apt-get --purge remove foo bar


      Verify how bar was packaged.



      apt-cache showpkg bar


      Under Dependencies: you can verify what version of foo is relevant to your version of bar. Now you can either grab bar with an apt-get download bar, apt-get install bar foo-, or wget the .deb straight from the repo to only get package bar.



      Next following the steps in the post we need to edit the dependency relationship.





      • Unpack deb: ar x bar.deb


      • Unpack control archive: tar xzf control.tar.gz


      • Fix dependencies in control [In this case, changing Depends: foo (= 1.6)]


      • Repack control.tar.gz: tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control [Change the parts in the brackets as it applies to what was extracted]


      • Repack deb: ar rcs newbar.deb debian-binary control.tar.gz data.tar.gz [order very important here!]





      Now complete the install of bar by issuing a apt-get -f install. It should now install the desired version of foo as a dependency.



      Please consult with the package maintainers to see if they have reasons for skipping that version of foo. Another option would be to install the version of foo manually and installing bar from source. Again, verify that the dependency requirements have been changed.



      You may also want to look into setting up and using APT-pinning for these packages to force apt to use only the version of a package that you want and make sure that the packages are sourced from the correct repo.



      From here you should have installed bar with dependency foo-1.6 . Please comment if you have any questions or issues with this answer. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.



      Best of Luck!






      share|improve this answer


























        -1












        -1








        -1






        So it goes without saying that this setup can potentially lead to FrankenDebian but if package bar and dependency foo are the only packages effected by this issue then there are methods to accomplish your goals.



        Take a look at the Debian documentation concerning relationships between packages. You are going to need to modify the package bar to have it depend the version of package foo that you desire. I have found this post to Sever Fault that could help.



        Rollback the installation of foo and bar (do not do this if it is going to cause further dependency issues!)



        apt-get --purge remove foo bar


        Verify how bar was packaged.



        apt-cache showpkg bar


        Under Dependencies: you can verify what version of foo is relevant to your version of bar. Now you can either grab bar with an apt-get download bar, apt-get install bar foo-, or wget the .deb straight from the repo to only get package bar.



        Next following the steps in the post we need to edit the dependency relationship.





        • Unpack deb: ar x bar.deb


        • Unpack control archive: tar xzf control.tar.gz


        • Fix dependencies in control [In this case, changing Depends: foo (= 1.6)]


        • Repack control.tar.gz: tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control [Change the parts in the brackets as it applies to what was extracted]


        • Repack deb: ar rcs newbar.deb debian-binary control.tar.gz data.tar.gz [order very important here!]





        Now complete the install of bar by issuing a apt-get -f install. It should now install the desired version of foo as a dependency.



        Please consult with the package maintainers to see if they have reasons for skipping that version of foo. Another option would be to install the version of foo manually and installing bar from source. Again, verify that the dependency requirements have been changed.



        You may also want to look into setting up and using APT-pinning for these packages to force apt to use only the version of a package that you want and make sure that the packages are sourced from the correct repo.



        From here you should have installed bar with dependency foo-1.6 . Please comment if you have any questions or issues with this answer. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.



        Best of Luck!






        share|improve this answer














        So it goes without saying that this setup can potentially lead to FrankenDebian but if package bar and dependency foo are the only packages effected by this issue then there are methods to accomplish your goals.



        Take a look at the Debian documentation concerning relationships between packages. You are going to need to modify the package bar to have it depend the version of package foo that you desire. I have found this post to Sever Fault that could help.



        Rollback the installation of foo and bar (do not do this if it is going to cause further dependency issues!)



        apt-get --purge remove foo bar


        Verify how bar was packaged.



        apt-cache showpkg bar


        Under Dependencies: you can verify what version of foo is relevant to your version of bar. Now you can either grab bar with an apt-get download bar, apt-get install bar foo-, or wget the .deb straight from the repo to only get package bar.



        Next following the steps in the post we need to edit the dependency relationship.





        • Unpack deb: ar x bar.deb


        • Unpack control archive: tar xzf control.tar.gz


        • Fix dependencies in control [In this case, changing Depends: foo (= 1.6)]


        • Repack control.tar.gz: tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control [Change the parts in the brackets as it applies to what was extracted]


        • Repack deb: ar rcs newbar.deb debian-binary control.tar.gz data.tar.gz [order very important here!]





        Now complete the install of bar by issuing a apt-get -f install. It should now install the desired version of foo as a dependency.



        Please consult with the package maintainers to see if they have reasons for skipping that version of foo. Another option would be to install the version of foo manually and installing bar from source. Again, verify that the dependency requirements have been changed.



        You may also want to look into setting up and using APT-pinning for these packages to force apt to use only the version of a package that you want and make sure that the packages are sourced from the correct repo.



        From here you should have installed bar with dependency foo-1.6 . Please comment if you have any questions or issues with this answer. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.



        Best of Luck!







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 19 at 21:44

























        answered Dec 19 at 20:51









        kemotep

        2,0213620




        2,0213620






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f489663%2finstall-virtual-package-of-specified-version%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

            Morgemoulin

            Scott Moir

            Souastre