apt-get build-dep is unable to find a source package

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











up vote
11
down vote

favorite
2












I have already followed this guide to disable middle mouse button paste on my Ubuntu 12.04.



Works like a charm.



Now I am trying to achieve the same on my Linux Mint 17. When I try to



sudo apt-get build-dep libgtk2.0-0


it gives me the following output:



Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0'
E: Unable to find a source package for gtk+2.0


For me it looks like apt-get is somehow "resolving" 'libgtk2.0-0' to 'gtk+2.0', but then does not find any package named like that.



EDIT:
although I am now able to compile the program (see my answer), I still do not know what Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' is supposed to mean. Any insight on this would be appreciated, thanks!










share|improve this question























  • Have you enabled the relevant deb-src repository in your /etc/apt/sources.list?
    – steeldriver
    Sep 30 '14 at 12:14














up vote
11
down vote

favorite
2












I have already followed this guide to disable middle mouse button paste on my Ubuntu 12.04.



Works like a charm.



Now I am trying to achieve the same on my Linux Mint 17. When I try to



sudo apt-get build-dep libgtk2.0-0


it gives me the following output:



Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0'
E: Unable to find a source package for gtk+2.0


For me it looks like apt-get is somehow "resolving" 'libgtk2.0-0' to 'gtk+2.0', but then does not find any package named like that.



EDIT:
although I am now able to compile the program (see my answer), I still do not know what Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' is supposed to mean. Any insight on this would be appreciated, thanks!










share|improve this question























  • Have you enabled the relevant deb-src repository in your /etc/apt/sources.list?
    – steeldriver
    Sep 30 '14 at 12:14












up vote
11
down vote

favorite
2









up vote
11
down vote

favorite
2






2





I have already followed this guide to disable middle mouse button paste on my Ubuntu 12.04.



Works like a charm.



Now I am trying to achieve the same on my Linux Mint 17. When I try to



sudo apt-get build-dep libgtk2.0-0


it gives me the following output:



Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0'
E: Unable to find a source package for gtk+2.0


For me it looks like apt-get is somehow "resolving" 'libgtk2.0-0' to 'gtk+2.0', but then does not find any package named like that.



EDIT:
although I am now able to compile the program (see my answer), I still do not know what Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' is supposed to mean. Any insight on this would be appreciated, thanks!










share|improve this question















I have already followed this guide to disable middle mouse button paste on my Ubuntu 12.04.



Works like a charm.



Now I am trying to achieve the same on my Linux Mint 17. When I try to



sudo apt-get build-dep libgtk2.0-0


it gives me the following output:



Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0'
E: Unable to find a source package for gtk+2.0


For me it looks like apt-get is somehow "resolving" 'libgtk2.0-0' to 'gtk+2.0', but then does not find any package named like that.



EDIT:
although I am now able to compile the program (see my answer), I still do not know what Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' is supposed to mean. Any insight on this would be appreciated, thanks!







apt compiling






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 13 at 11:13









GAD3R

23.7k1648100




23.7k1648100










asked Sep 30 '14 at 10:45









panepeter

2081210




2081210











  • Have you enabled the relevant deb-src repository in your /etc/apt/sources.list?
    – steeldriver
    Sep 30 '14 at 12:14
















  • Have you enabled the relevant deb-src repository in your /etc/apt/sources.list?
    – steeldriver
    Sep 30 '14 at 12:14















Have you enabled the relevant deb-src repository in your /etc/apt/sources.list?
– steeldriver
Sep 30 '14 at 12:14




Have you enabled the relevant deb-src repository in your /etc/apt/sources.list?
– steeldriver
Sep 30 '14 at 12:14










3 Answers
3






active

oldest

votes

















up vote
13
down vote



accepted










As others have already noted, make sure that for every deb … entry in /etc/apt/sources.list and /etc/apt/sources.list.d/*, you have a matching deb-src … entry. The rest of the line must be identical. The deb entry is for binary packages (i.e. ready to install), the deb-src is for source packages (i.e. ready to compile). The reason why the two kinds of sources are separated is that they are managed very differently: binary packages have a dependency tracking mechanism and a currently-installed list, whereas source packages are only tracked so that they can be downloaded conveniently. Note that when discussing package repositories, the word source means two unrelated things: a source as in a location to download packages from, and a source package as opposed to a binary package.



libgtk2.0-0 is the name of a binary package. It is built from a source package called gtk+2.0. The reason source and binary package names don't always match is that building a source package can produce multiple binary packages; for example, gtk+2.0 is the source for 14 packages as it is split into two libraries (libgtk2.0, libgail), corresponding packages to build programs using these libraries (…-dev), documentation for developers (…-doc), companion programs (libgtk2.0-bin`), etc.



You can see the name of the source package corresponding to a binary package by checking the Source: … line in the output of dpkg -s BINARY_PACKAGE_NAME (if the package is installed) or apt-cache show BINARY_PACKAGE_NAME. You can list the binary packages produced by a source package with aptitude search '?source-package(^SOURCE_PACKAGE_NAME$).



The command apt-get source downloads a source package. If you give it an argument which isn't a known source package, it looks it up in the database of installable binary packages and tries to download the corresponding source package. The command apt-get build-dep follows the same approach to deduce the name of a source package, then queries the source package database to obtain a list of binary packages (the list in the Build-Dep: field), and installs those binary packages.



The Software Sources GUI has a checkbox “enable repositories with source code” for official repositories, make sure that it's ticked. If you add third-party repositories manually, make sure that you add both deb-src and deb lines.






share|improve this answer





























    up vote
    5
    down vote













    Thanks to @steeldriver, I figured out what to do.



    Just had to add the following ling to my /etc/apt/sources.list:



    deb-src ftp://ftp.de.debian.org/debian/ stable main contrib


    deb-src repositories contain sources packages (as opposed to binary, ready-to-install packages) needed for compiling.



    Edit: After Adding this, you must execute sudo apt-get update






    share|improve this answer





























      up vote
      2
      down vote













      For the lazy and the Dockerers:



      sudo sed -Ei 's/^# deb-src/deb-src/' /etc/apt/sources.list
      sudo apt-get update
      sudo build-dep qemu


      Tested on Ubuntu 18.04.






      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%2f158395%2fapt-get-build-dep-is-unable-to-find-a-source-package%23new-answer', 'question_page');

        );

        Post as a guest






























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        13
        down vote



        accepted










        As others have already noted, make sure that for every deb … entry in /etc/apt/sources.list and /etc/apt/sources.list.d/*, you have a matching deb-src … entry. The rest of the line must be identical. The deb entry is for binary packages (i.e. ready to install), the deb-src is for source packages (i.e. ready to compile). The reason why the two kinds of sources are separated is that they are managed very differently: binary packages have a dependency tracking mechanism and a currently-installed list, whereas source packages are only tracked so that they can be downloaded conveniently. Note that when discussing package repositories, the word source means two unrelated things: a source as in a location to download packages from, and a source package as opposed to a binary package.



        libgtk2.0-0 is the name of a binary package. It is built from a source package called gtk+2.0. The reason source and binary package names don't always match is that building a source package can produce multiple binary packages; for example, gtk+2.0 is the source for 14 packages as it is split into two libraries (libgtk2.0, libgail), corresponding packages to build programs using these libraries (…-dev), documentation for developers (…-doc), companion programs (libgtk2.0-bin`), etc.



        You can see the name of the source package corresponding to a binary package by checking the Source: … line in the output of dpkg -s BINARY_PACKAGE_NAME (if the package is installed) or apt-cache show BINARY_PACKAGE_NAME. You can list the binary packages produced by a source package with aptitude search '?source-package(^SOURCE_PACKAGE_NAME$).



        The command apt-get source downloads a source package. If you give it an argument which isn't a known source package, it looks it up in the database of installable binary packages and tries to download the corresponding source package. The command apt-get build-dep follows the same approach to deduce the name of a source package, then queries the source package database to obtain a list of binary packages (the list in the Build-Dep: field), and installs those binary packages.



        The Software Sources GUI has a checkbox “enable repositories with source code” for official repositories, make sure that it's ticked. If you add third-party repositories manually, make sure that you add both deb-src and deb lines.






        share|improve this answer


























          up vote
          13
          down vote



          accepted










          As others have already noted, make sure that for every deb … entry in /etc/apt/sources.list and /etc/apt/sources.list.d/*, you have a matching deb-src … entry. The rest of the line must be identical. The deb entry is for binary packages (i.e. ready to install), the deb-src is for source packages (i.e. ready to compile). The reason why the two kinds of sources are separated is that they are managed very differently: binary packages have a dependency tracking mechanism and a currently-installed list, whereas source packages are only tracked so that they can be downloaded conveniently. Note that when discussing package repositories, the word source means two unrelated things: a source as in a location to download packages from, and a source package as opposed to a binary package.



          libgtk2.0-0 is the name of a binary package. It is built from a source package called gtk+2.0. The reason source and binary package names don't always match is that building a source package can produce multiple binary packages; for example, gtk+2.0 is the source for 14 packages as it is split into two libraries (libgtk2.0, libgail), corresponding packages to build programs using these libraries (…-dev), documentation for developers (…-doc), companion programs (libgtk2.0-bin`), etc.



          You can see the name of the source package corresponding to a binary package by checking the Source: … line in the output of dpkg -s BINARY_PACKAGE_NAME (if the package is installed) or apt-cache show BINARY_PACKAGE_NAME. You can list the binary packages produced by a source package with aptitude search '?source-package(^SOURCE_PACKAGE_NAME$).



          The command apt-get source downloads a source package. If you give it an argument which isn't a known source package, it looks it up in the database of installable binary packages and tries to download the corresponding source package. The command apt-get build-dep follows the same approach to deduce the name of a source package, then queries the source package database to obtain a list of binary packages (the list in the Build-Dep: field), and installs those binary packages.



          The Software Sources GUI has a checkbox “enable repositories with source code” for official repositories, make sure that it's ticked. If you add third-party repositories manually, make sure that you add both deb-src and deb lines.






          share|improve this answer
























            up vote
            13
            down vote



            accepted







            up vote
            13
            down vote



            accepted






            As others have already noted, make sure that for every deb … entry in /etc/apt/sources.list and /etc/apt/sources.list.d/*, you have a matching deb-src … entry. The rest of the line must be identical. The deb entry is for binary packages (i.e. ready to install), the deb-src is for source packages (i.e. ready to compile). The reason why the two kinds of sources are separated is that they are managed very differently: binary packages have a dependency tracking mechanism and a currently-installed list, whereas source packages are only tracked so that they can be downloaded conveniently. Note that when discussing package repositories, the word source means two unrelated things: a source as in a location to download packages from, and a source package as opposed to a binary package.



            libgtk2.0-0 is the name of a binary package. It is built from a source package called gtk+2.0. The reason source and binary package names don't always match is that building a source package can produce multiple binary packages; for example, gtk+2.0 is the source for 14 packages as it is split into two libraries (libgtk2.0, libgail), corresponding packages to build programs using these libraries (…-dev), documentation for developers (…-doc), companion programs (libgtk2.0-bin`), etc.



            You can see the name of the source package corresponding to a binary package by checking the Source: … line in the output of dpkg -s BINARY_PACKAGE_NAME (if the package is installed) or apt-cache show BINARY_PACKAGE_NAME. You can list the binary packages produced by a source package with aptitude search '?source-package(^SOURCE_PACKAGE_NAME$).



            The command apt-get source downloads a source package. If you give it an argument which isn't a known source package, it looks it up in the database of installable binary packages and tries to download the corresponding source package. The command apt-get build-dep follows the same approach to deduce the name of a source package, then queries the source package database to obtain a list of binary packages (the list in the Build-Dep: field), and installs those binary packages.



            The Software Sources GUI has a checkbox “enable repositories with source code” for official repositories, make sure that it's ticked. If you add third-party repositories manually, make sure that you add both deb-src and deb lines.






            share|improve this answer














            As others have already noted, make sure that for every deb … entry in /etc/apt/sources.list and /etc/apt/sources.list.d/*, you have a matching deb-src … entry. The rest of the line must be identical. The deb entry is for binary packages (i.e. ready to install), the deb-src is for source packages (i.e. ready to compile). The reason why the two kinds of sources are separated is that they are managed very differently: binary packages have a dependency tracking mechanism and a currently-installed list, whereas source packages are only tracked so that they can be downloaded conveniently. Note that when discussing package repositories, the word source means two unrelated things: a source as in a location to download packages from, and a source package as opposed to a binary package.



            libgtk2.0-0 is the name of a binary package. It is built from a source package called gtk+2.0. The reason source and binary package names don't always match is that building a source package can produce multiple binary packages; for example, gtk+2.0 is the source for 14 packages as it is split into two libraries (libgtk2.0, libgail), corresponding packages to build programs using these libraries (…-dev), documentation for developers (…-doc), companion programs (libgtk2.0-bin`), etc.



            You can see the name of the source package corresponding to a binary package by checking the Source: … line in the output of dpkg -s BINARY_PACKAGE_NAME (if the package is installed) or apt-cache show BINARY_PACKAGE_NAME. You can list the binary packages produced by a source package with aptitude search '?source-package(^SOURCE_PACKAGE_NAME$).



            The command apt-get source downloads a source package. If you give it an argument which isn't a known source package, it looks it up in the database of installable binary packages and tries to download the corresponding source package. The command apt-get build-dep follows the same approach to deduce the name of a source package, then queries the source package database to obtain a list of binary packages (the list in the Build-Dep: field), and installs those binary packages.



            The Software Sources GUI has a checkbox “enable repositories with source code” for official repositories, make sure that it's ticked. If you add third-party repositories manually, make sure that you add both deb-src and deb lines.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 26 '15 at 17:37

























            answered Sep 30 '14 at 22:55









            Gilles

            515k12210251554




            515k12210251554






















                up vote
                5
                down vote













                Thanks to @steeldriver, I figured out what to do.



                Just had to add the following ling to my /etc/apt/sources.list:



                deb-src ftp://ftp.de.debian.org/debian/ stable main contrib


                deb-src repositories contain sources packages (as opposed to binary, ready-to-install packages) needed for compiling.



                Edit: After Adding this, you must execute sudo apt-get update






                share|improve this answer


























                  up vote
                  5
                  down vote













                  Thanks to @steeldriver, I figured out what to do.



                  Just had to add the following ling to my /etc/apt/sources.list:



                  deb-src ftp://ftp.de.debian.org/debian/ stable main contrib


                  deb-src repositories contain sources packages (as opposed to binary, ready-to-install packages) needed for compiling.



                  Edit: After Adding this, you must execute sudo apt-get update






                  share|improve this answer
























                    up vote
                    5
                    down vote










                    up vote
                    5
                    down vote









                    Thanks to @steeldriver, I figured out what to do.



                    Just had to add the following ling to my /etc/apt/sources.list:



                    deb-src ftp://ftp.de.debian.org/debian/ stable main contrib


                    deb-src repositories contain sources packages (as opposed to binary, ready-to-install packages) needed for compiling.



                    Edit: After Adding this, you must execute sudo apt-get update






                    share|improve this answer














                    Thanks to @steeldriver, I figured out what to do.



                    Just had to add the following ling to my /etc/apt/sources.list:



                    deb-src ftp://ftp.de.debian.org/debian/ stable main contrib


                    deb-src repositories contain sources packages (as opposed to binary, ready-to-install packages) needed for compiling.



                    Edit: After Adding this, you must execute sudo apt-get update







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Oct 29 '16 at 6:41









                    VVJ

                    1033




                    1033










                    answered Sep 30 '14 at 13:40









                    panepeter

                    2081210




                    2081210




















                        up vote
                        2
                        down vote













                        For the lazy and the Dockerers:



                        sudo sed -Ei 's/^# deb-src/deb-src/' /etc/apt/sources.list
                        sudo apt-get update
                        sudo build-dep qemu


                        Tested on Ubuntu 18.04.






                        share|improve this answer


























                          up vote
                          2
                          down vote













                          For the lazy and the Dockerers:



                          sudo sed -Ei 's/^# deb-src/deb-src/' /etc/apt/sources.list
                          sudo apt-get update
                          sudo build-dep qemu


                          Tested on Ubuntu 18.04.






                          share|improve this answer
























                            up vote
                            2
                            down vote










                            up vote
                            2
                            down vote









                            For the lazy and the Dockerers:



                            sudo sed -Ei 's/^# deb-src/deb-src/' /etc/apt/sources.list
                            sudo apt-get update
                            sudo build-dep qemu


                            Tested on Ubuntu 18.04.






                            share|improve this answer














                            For the lazy and the Dockerers:



                            sudo sed -Ei 's/^# deb-src/deb-src/' /etc/apt/sources.list
                            sudo apt-get update
                            sudo build-dep qemu


                            Tested on Ubuntu 18.04.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 3 mins ago

























                            answered Apr 7 at 19:33









                            Ciro Santilli 新疆改造中心 六四事件 法轮功

                            4,52123938




                            4,52123938



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f158395%2fapt-get-build-dep-is-unable-to-find-a-source-package%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?

                                Bahrain

                                Postfix configuration issue with fips on centos 7; mailgun relay