How do I find out which repository a package comes from?












133















Is there a method or command which can tell from which repository a package is coming from?










share|improve this question




















  • 1





    This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I'm looking for the latter, not the former.)

    – Reinier Post
    May 25 '17 at 16:59


















133















Is there a method or command which can tell from which repository a package is coming from?










share|improve this question




















  • 1





    This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I'm looking for the latter, not the former.)

    – Reinier Post
    May 25 '17 at 16:59
















133












133








133


27






Is there a method or command which can tell from which repository a package is coming from?










share|improve this question
















Is there a method or command which can tell from which repository a package is coming from?







apt package-management repository






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 12 '17 at 10:58









David Foerster

28.5k1367113




28.5k1367113










asked Oct 20 '10 at 20:43









dfmedfme

768264




768264








  • 1





    This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I'm looking for the latter, not the former.)

    – Reinier Post
    May 25 '17 at 16:59
















  • 1





    This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I'm looking for the latter, not the former.)

    – Reinier Post
    May 25 '17 at 16:59










1




1





This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I'm looking for the latter, not the former.)

– Reinier Post
May 25 '17 at 16:59







This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I'm looking for the latter, not the former.)

– Reinier Post
May 25 '17 at 16:59












6 Answers
6






active

oldest

votes


















99














Commands Needed:





  • dpkg -s <package> - allows you to
    find the version of that
    you have installed. (source)


  • apt-cache showpkg <package> - will
    show a list of Versions of the
    package available. For each version,
    the source of the package, in the
    form of an index file name, will be
    given.


If you want to find the source of the package that's currently installed, you'll need the output of dpkg -s <package>. Otherwise, you can simply look at the newest version output by apt-cache showpkg <package>.



Example:



$ dpkg -s liferea
Package: liferea
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 760
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Version: 1.6.2-1ubuntu6
...

$ apt-cache showpkg liferea
Package: liferea
Versions:
1.6.2-1ubuntu6.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages)
Description Language:
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages
MD5: 557b0b803b7ed864e6d14df4b02e3d26

1.6.2-1ubuntu6 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
Description Language:
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages
MD5: 557b0b803b7ed864e6d14df4b02e3d26
...


From the first command, I can see that Liferea version 1.6.2-1ubuntu6 is installed. From the second command, I can see that that version is listed in /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages.



Without too much effort, I can deduce that the source line contains archive.ubuntu.com, ubuntu, lucid, and main.



And, sure enough, my /etc/apt/sources.list contains the following line.



deb http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse





share|improve this answer


























  • mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

    – dfme
    Oct 20 '10 at 22:23











  • It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

    – mac9416
    Oct 21 '10 at 13:10






  • 4





    apt-cache policy <package name> (from: superuser.com/a/236605/37279)

    – franzlorenzon
    Aug 1 '13 at 14:47











  • Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

    – Croad Langshan
    Feb 21 '15 at 11:36






  • 1





    The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

    – blubberdiblub
    Jul 4 '15 at 1:22



















97














Use following command. It has better output:



apt-cache policy <Package Name>


For Ubuntu 16.04 and later there is a shorter way to do that:



apt policy <Package Name>





share|improve this answer





















  • 11





    This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

    – pabouk
    Nov 23 '15 at 9:45








  • 3





    apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

    – gavenkoa
    Dec 9 '15 at 11:03













  • this policy option is the most useful when comparing with sources.list

    – infinite-etcetera
    Jan 26 '17 at 13:06













  • This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

    – HEXcube
    Sep 23 '17 at 13:07











  • Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

    – HEXcube
    Sep 23 '17 at 13:12





















7















apt on Ubuntu 16.04+



Beside apt-cache policy, showpkg and show, now we have a more simple, with easy to remember subcommands: apt (don't confuse with classic apt-*):



apt policy <package> 


or the alternative with more info apt show <package>, line starting with "APT-Sources:".



Description: This package provides commandline tools for searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. These include:apt-get, apt-cache, apt-cdrom, apt-config, apt-key.



Basic commands from apt --help



Other also easy to remember subcommands:





  • apt list – list packages based on package names


  • apt search – search in package descriptions


  • apt show – show package details


  • apt update – update list of available packages


  • apt install – install packages


  • apt remove – remove packages


  • apt purge – remove packages and configuration files:




    Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.




  • apt upgrade – upgrade the system by installing/upgrading packages



  • apt full-upgrade – upgrade the system by removing/installing/upgrading packages


  • apt edit-sources – edit the source information file






share|improve this answer


























  • apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

    – Xen2050
    Dec 23 '17 at 23:00



















6














Sadly, this information is not recorded during package installation. You can make a decent guess if the repository is still in the source list and the repository still has the package:



grep -l PKG /var/lib/apt/lists/*


Even synaptic cannot tell if you disable the repository and update.






share|improve this answer































    4














    sudo grep *packagename* /var/lib/apt/lists/* | grep "Filename:"


    source






    share|improve this answer

































      1














      This is a little more accurate:



      apt-cache show <packagename> | grep "Version:"


      The newest version will typically be installed unless you have set apt-pinning or explicitly install a particular version.






      share|improve this answer























        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%2f8560%2fhow-do-i-find-out-which-repository-a-package-comes-from%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        99














        Commands Needed:





        • dpkg -s <package> - allows you to
          find the version of that
          you have installed. (source)


        • apt-cache showpkg <package> - will
          show a list of Versions of the
          package available. For each version,
          the source of the package, in the
          form of an index file name, will be
          given.


        If you want to find the source of the package that's currently installed, you'll need the output of dpkg -s <package>. Otherwise, you can simply look at the newest version output by apt-cache showpkg <package>.



        Example:



        $ dpkg -s liferea
        Package: liferea
        Status: install ok installed
        Priority: optional
        Section: web
        Installed-Size: 760
        Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
        Architecture: i386
        Version: 1.6.2-1ubuntu6
        ...

        $ apt-cache showpkg liferea
        Package: liferea
        Versions:
        1.6.2-1ubuntu6.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26

        1.6.2-1ubuntu6 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26
        ...


        From the first command, I can see that Liferea version 1.6.2-1ubuntu6 is installed. From the second command, I can see that that version is listed in /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages.



        Without too much effort, I can deduce that the source line contains archive.ubuntu.com, ubuntu, lucid, and main.



        And, sure enough, my /etc/apt/sources.list contains the following line.



        deb http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse





        share|improve this answer


























        • mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

          – dfme
          Oct 20 '10 at 22:23











        • It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

          – mac9416
          Oct 21 '10 at 13:10






        • 4





          apt-cache policy <package name> (from: superuser.com/a/236605/37279)

          – franzlorenzon
          Aug 1 '13 at 14:47











        • Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

          – Croad Langshan
          Feb 21 '15 at 11:36






        • 1





          The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

          – blubberdiblub
          Jul 4 '15 at 1:22
















        99














        Commands Needed:





        • dpkg -s <package> - allows you to
          find the version of that
          you have installed. (source)


        • apt-cache showpkg <package> - will
          show a list of Versions of the
          package available. For each version,
          the source of the package, in the
          form of an index file name, will be
          given.


        If you want to find the source of the package that's currently installed, you'll need the output of dpkg -s <package>. Otherwise, you can simply look at the newest version output by apt-cache showpkg <package>.



        Example:



        $ dpkg -s liferea
        Package: liferea
        Status: install ok installed
        Priority: optional
        Section: web
        Installed-Size: 760
        Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
        Architecture: i386
        Version: 1.6.2-1ubuntu6
        ...

        $ apt-cache showpkg liferea
        Package: liferea
        Versions:
        1.6.2-1ubuntu6.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26

        1.6.2-1ubuntu6 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26
        ...


        From the first command, I can see that Liferea version 1.6.2-1ubuntu6 is installed. From the second command, I can see that that version is listed in /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages.



        Without too much effort, I can deduce that the source line contains archive.ubuntu.com, ubuntu, lucid, and main.



        And, sure enough, my /etc/apt/sources.list contains the following line.



        deb http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse





        share|improve this answer


























        • mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

          – dfme
          Oct 20 '10 at 22:23











        • It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

          – mac9416
          Oct 21 '10 at 13:10






        • 4





          apt-cache policy <package name> (from: superuser.com/a/236605/37279)

          – franzlorenzon
          Aug 1 '13 at 14:47











        • Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

          – Croad Langshan
          Feb 21 '15 at 11:36






        • 1





          The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

          – blubberdiblub
          Jul 4 '15 at 1:22














        99












        99








        99







        Commands Needed:





        • dpkg -s <package> - allows you to
          find the version of that
          you have installed. (source)


        • apt-cache showpkg <package> - will
          show a list of Versions of the
          package available. For each version,
          the source of the package, in the
          form of an index file name, will be
          given.


        If you want to find the source of the package that's currently installed, you'll need the output of dpkg -s <package>. Otherwise, you can simply look at the newest version output by apt-cache showpkg <package>.



        Example:



        $ dpkg -s liferea
        Package: liferea
        Status: install ok installed
        Priority: optional
        Section: web
        Installed-Size: 760
        Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
        Architecture: i386
        Version: 1.6.2-1ubuntu6
        ...

        $ apt-cache showpkg liferea
        Package: liferea
        Versions:
        1.6.2-1ubuntu6.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26

        1.6.2-1ubuntu6 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26
        ...


        From the first command, I can see that Liferea version 1.6.2-1ubuntu6 is installed. From the second command, I can see that that version is listed in /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages.



        Without too much effort, I can deduce that the source line contains archive.ubuntu.com, ubuntu, lucid, and main.



        And, sure enough, my /etc/apt/sources.list contains the following line.



        deb http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse





        share|improve this answer















        Commands Needed:





        • dpkg -s <package> - allows you to
          find the version of that
          you have installed. (source)


        • apt-cache showpkg <package> - will
          show a list of Versions of the
          package available. For each version,
          the source of the package, in the
          form of an index file name, will be
          given.


        If you want to find the source of the package that's currently installed, you'll need the output of dpkg -s <package>. Otherwise, you can simply look at the newest version output by apt-cache showpkg <package>.



        Example:



        $ dpkg -s liferea
        Package: liferea
        Status: install ok installed
        Priority: optional
        Section: web
        Installed-Size: 760
        Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
        Architecture: i386
        Version: 1.6.2-1ubuntu6
        ...

        $ apt-cache showpkg liferea
        Package: liferea
        Versions:
        1.6.2-1ubuntu6.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26

        1.6.2-1ubuntu6 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
        Description Language:
        File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages
        MD5: 557b0b803b7ed864e6d14df4b02e3d26
        ...


        From the first command, I can see that Liferea version 1.6.2-1ubuntu6 is installed. From the second command, I can see that that version is listed in /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages.



        Without too much effort, I can deduce that the source line contains archive.ubuntu.com, ubuntu, lucid, and main.



        And, sure enough, my /etc/apt/sources.list contains the following line.



        deb http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 20 '17 at 20:22









        wjandrea

        9,40542664




        9,40542664










        answered Oct 20 '10 at 21:49









        mac9416mac9416

        16.5k63446




        16.5k63446













        • mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

          – dfme
          Oct 20 '10 at 22:23











        • It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

          – mac9416
          Oct 21 '10 at 13:10






        • 4





          apt-cache policy <package name> (from: superuser.com/a/236605/37279)

          – franzlorenzon
          Aug 1 '13 at 14:47











        • Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

          – Croad Langshan
          Feb 21 '15 at 11:36






        • 1





          The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

          – blubberdiblub
          Jul 4 '15 at 1:22



















        • mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

          – dfme
          Oct 20 '10 at 22:23











        • It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

          – mac9416
          Oct 21 '10 at 13:10






        • 4





          apt-cache policy <package name> (from: superuser.com/a/236605/37279)

          – franzlorenzon
          Aug 1 '13 at 14:47











        • Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

          – Croad Langshan
          Feb 21 '15 at 11:36






        • 1





          The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

          – blubberdiblub
          Jul 4 '15 at 1:22

















        mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

        – dfme
        Oct 20 '10 at 22:23





        mac, thanks for your detailed answer! Unfortunately it doesn't help me with my initial issue of an unmet dependency problem :-( I'm trying to install libqt4-opengl and it says: The following packages have unmet dependencies: libqt4-opengl: Depends: libqtcore4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed Depends: libqtgui4 (= 4:4.6.2-0ubuntu5.1) but 4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1+appmenu20100624 is to be installed

        – dfme
        Oct 20 '10 at 22:23













        It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

        – mac9416
        Oct 21 '10 at 13:10





        It's difficult to see from that just what the problem is. You should open a new question so you can provide full details. If you do, leave a link in a comment. :-)

        – mac9416
        Oct 21 '10 at 13:10




        4




        4





        apt-cache policy <package name> (from: superuser.com/a/236605/37279)

        – franzlorenzon
        Aug 1 '13 at 14:47





        apt-cache policy <package name> (from: superuser.com/a/236605/37279)

        – franzlorenzon
        Aug 1 '13 at 14:47













        Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

        – Croad Langshan
        Feb 21 '15 at 11:36





        Do apt-cache {showpkg,policy} actually show where an installed package was installed from, or just where it would be installed from at the time it is queried?

        – Croad Langshan
        Feb 21 '15 at 11:36




        1




        1





        The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

        – blubberdiblub
        Jul 4 '15 at 1:22





        The latter. If I generally use Ubuntu trusty package sources, then temporarily add utopic to my sources.list in order to install version 1.20ubuntu3 of init-system-helpers and then remove the repo again from my sources.list, apt-cache showpkg init-system-helpers will just lie about the original package list and apt-cache policy init-system-helpers will just state the obvious.

        – blubberdiblub
        Jul 4 '15 at 1:22













        97














        Use following command. It has better output:



        apt-cache policy <Package Name>


        For Ubuntu 16.04 and later there is a shorter way to do that:



        apt policy <Package Name>





        share|improve this answer





















        • 11





          This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

          – pabouk
          Nov 23 '15 at 9:45








        • 3





          apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

          – gavenkoa
          Dec 9 '15 at 11:03













        • this policy option is the most useful when comparing with sources.list

          – infinite-etcetera
          Jan 26 '17 at 13:06













        • This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

          – HEXcube
          Sep 23 '17 at 13:07











        • Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

          – HEXcube
          Sep 23 '17 at 13:12


















        97














        Use following command. It has better output:



        apt-cache policy <Package Name>


        For Ubuntu 16.04 and later there is a shorter way to do that:



        apt policy <Package Name>





        share|improve this answer





















        • 11





          This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

          – pabouk
          Nov 23 '15 at 9:45








        • 3





          apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

          – gavenkoa
          Dec 9 '15 at 11:03













        • this policy option is the most useful when comparing with sources.list

          – infinite-etcetera
          Jan 26 '17 at 13:06













        • This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

          – HEXcube
          Sep 23 '17 at 13:07











        • Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

          – HEXcube
          Sep 23 '17 at 13:12
















        97












        97








        97







        Use following command. It has better output:



        apt-cache policy <Package Name>


        For Ubuntu 16.04 and later there is a shorter way to do that:



        apt policy <Package Name>





        share|improve this answer















        Use following command. It has better output:



        apt-cache policy <Package Name>


        For Ubuntu 16.04 and later there is a shorter way to do that:



        apt policy <Package Name>






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 4 '18 at 5:43

























        answered Sep 20 '13 at 6:21









        SuBSuB

        2,03721631




        2,03721631








        • 11





          This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

          – pabouk
          Nov 23 '15 at 9:45








        • 3





          apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

          – gavenkoa
          Dec 9 '15 at 11:03













        • this policy option is the most useful when comparing with sources.list

          – infinite-etcetera
          Jan 26 '17 at 13:06













        • This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

          – HEXcube
          Sep 23 '17 at 13:07











        • Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

          – HEXcube
          Sep 23 '17 at 13:12
















        • 11





          This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

          – pabouk
          Nov 23 '15 at 9:45








        • 3





          apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

          – gavenkoa
          Dec 9 '15 at 11:03













        • this policy option is the most useful when comparing with sources.list

          – infinite-etcetera
          Jan 26 '17 at 13:06













        • This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

          – HEXcube
          Sep 23 '17 at 13:07











        • Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

          – HEXcube
          Sep 23 '17 at 13:12










        11




        11





        This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

        – pabouk
        Nov 23 '15 at 9:45







        This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

        – pabouk
        Nov 23 '15 at 9:45






        3




        3





        apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

        – gavenkoa
        Dec 9 '15 at 11:03







        apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums --changed

        – gavenkoa
        Dec 9 '15 at 11:03















        this policy option is the most useful when comparing with sources.list

        – infinite-etcetera
        Jan 26 '17 at 13:06







        this policy option is the most useful when comparing with sources.list

        – infinite-etcetera
        Jan 26 '17 at 13:06















        This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

        – HEXcube
        Sep 23 '17 at 13:07





        This should be the accepted answer! @pabouk is right. This answer's more relevant to the question than the currently accepted one.

        – HEXcube
        Sep 23 '17 at 13:07













        Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

        – HEXcube
        Sep 23 '17 at 13:12







        Like @pablo-bianchi pointed out in his answer, an even simpler apt policy <package-name> can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL'd in 2018, this answer maybe edited to use the newer command.

        – HEXcube
        Sep 23 '17 at 13:12













        7















        apt on Ubuntu 16.04+



        Beside apt-cache policy, showpkg and show, now we have a more simple, with easy to remember subcommands: apt (don't confuse with classic apt-*):



        apt policy <package> 


        or the alternative with more info apt show <package>, line starting with "APT-Sources:".



        Description: This package provides commandline tools for searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. These include:apt-get, apt-cache, apt-cdrom, apt-config, apt-key.



        Basic commands from apt --help



        Other also easy to remember subcommands:





        • apt list – list packages based on package names


        • apt search – search in package descriptions


        • apt show – show package details


        • apt update – update list of available packages


        • apt install – install packages


        • apt remove – remove packages


        • apt purge – remove packages and configuration files:




          Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.




        • apt upgrade – upgrade the system by installing/upgrading packages



        • apt full-upgrade – upgrade the system by removing/installing/upgrading packages


        • apt edit-sources – edit the source information file






        share|improve this answer


























        • apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

          – Xen2050
          Dec 23 '17 at 23:00
















        7















        apt on Ubuntu 16.04+



        Beside apt-cache policy, showpkg and show, now we have a more simple, with easy to remember subcommands: apt (don't confuse with classic apt-*):



        apt policy <package> 


        or the alternative with more info apt show <package>, line starting with "APT-Sources:".



        Description: This package provides commandline tools for searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. These include:apt-get, apt-cache, apt-cdrom, apt-config, apt-key.



        Basic commands from apt --help



        Other also easy to remember subcommands:





        • apt list – list packages based on package names


        • apt search – search in package descriptions


        • apt show – show package details


        • apt update – update list of available packages


        • apt install – install packages


        • apt remove – remove packages


        • apt purge – remove packages and configuration files:




          Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.




        • apt upgrade – upgrade the system by installing/upgrading packages



        • apt full-upgrade – upgrade the system by removing/installing/upgrading packages


        • apt edit-sources – edit the source information file






        share|improve this answer


























        • apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

          – Xen2050
          Dec 23 '17 at 23:00














        7












        7








        7








        apt on Ubuntu 16.04+



        Beside apt-cache policy, showpkg and show, now we have a more simple, with easy to remember subcommands: apt (don't confuse with classic apt-*):



        apt policy <package> 


        or the alternative with more info apt show <package>, line starting with "APT-Sources:".



        Description: This package provides commandline tools for searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. These include:apt-get, apt-cache, apt-cdrom, apt-config, apt-key.



        Basic commands from apt --help



        Other also easy to remember subcommands:





        • apt list – list packages based on package names


        • apt search – search in package descriptions


        • apt show – show package details


        • apt update – update list of available packages


        • apt install – install packages


        • apt remove – remove packages


        • apt purge – remove packages and configuration files:




          Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.




        • apt upgrade – upgrade the system by installing/upgrading packages



        • apt full-upgrade – upgrade the system by removing/installing/upgrading packages


        • apt edit-sources – edit the source information file






        share|improve this answer
















        apt on Ubuntu 16.04+



        Beside apt-cache policy, showpkg and show, now we have a more simple, with easy to remember subcommands: apt (don't confuse with classic apt-*):



        apt policy <package> 


        or the alternative with more info apt show <package>, line starting with "APT-Sources:".



        Description: This package provides commandline tools for searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. These include:apt-get, apt-cache, apt-cdrom, apt-config, apt-key.



        Basic commands from apt --help



        Other also easy to remember subcommands:





        • apt list – list packages based on package names


        • apt search – search in package descriptions


        • apt show – show package details


        • apt update – update list of available packages


        • apt install – install packages


        • apt remove – remove packages


        • apt purge – remove packages and configuration files:




          Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.




        • apt upgrade – upgrade the system by installing/upgrading packages



        • apt full-upgrade – upgrade the system by removing/installing/upgrading packages


        • apt edit-sources – edit the source information file







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 4 at 17:45

























        answered Jun 1 '17 at 19:27









        Pablo BianchiPablo Bianchi

        2,97021535




        2,97021535













        • apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

          – Xen2050
          Dec 23 '17 at 23:00



















        • apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

          – Xen2050
          Dec 23 '17 at 23:00

















        apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

        – Xen2050
        Dec 23 '17 at 23:00





        apt policy xxx appears identical to apt-cache policy xxx, maybe this should've been a comment instead. Or at least mention that apt show seems to need the -a switch to see "additional records" from other sources

        – Xen2050
        Dec 23 '17 at 23:00











        6














        Sadly, this information is not recorded during package installation. You can make a decent guess if the repository is still in the source list and the repository still has the package:



        grep -l PKG /var/lib/apt/lists/*


        Even synaptic cannot tell if you disable the repository and update.






        share|improve this answer




























          6














          Sadly, this information is not recorded during package installation. You can make a decent guess if the repository is still in the source list and the repository still has the package:



          grep -l PKG /var/lib/apt/lists/*


          Even synaptic cannot tell if you disable the repository and update.






          share|improve this answer


























            6












            6








            6







            Sadly, this information is not recorded during package installation. You can make a decent guess if the repository is still in the source list and the repository still has the package:



            grep -l PKG /var/lib/apt/lists/*


            Even synaptic cannot tell if you disable the repository and update.






            share|improve this answer













            Sadly, this information is not recorded during package installation. You can make a decent guess if the repository is still in the source list and the repository still has the package:



            grep -l PKG /var/lib/apt/lists/*


            Even synaptic cannot tell if you disable the repository and update.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 20 '10 at 21:37









            kanakakanaka

            21313




            21313























                4














                sudo grep *packagename* /var/lib/apt/lists/* | grep "Filename:"


                source






                share|improve this answer






























                  4














                  sudo grep *packagename* /var/lib/apt/lists/* | grep "Filename:"


                  source






                  share|improve this answer




























                    4












                    4








                    4







                    sudo grep *packagename* /var/lib/apt/lists/* | grep "Filename:"


                    source






                    share|improve this answer















                    sudo grep *packagename* /var/lib/apt/lists/* | grep "Filename:"


                    source







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Mar 20 '17 at 10:18









                    Community

                    1




                    1










                    answered Oct 20 '10 at 21:29









                    sBlattsBlatt

                    3,04921519




                    3,04921519























                        1














                        This is a little more accurate:



                        apt-cache show <packagename> | grep "Version:"


                        The newest version will typically be installed unless you have set apt-pinning or explicitly install a particular version.






                        share|improve this answer




























                          1














                          This is a little more accurate:



                          apt-cache show <packagename> | grep "Version:"


                          The newest version will typically be installed unless you have set apt-pinning or explicitly install a particular version.






                          share|improve this answer


























                            1












                            1








                            1







                            This is a little more accurate:



                            apt-cache show <packagename> | grep "Version:"


                            The newest version will typically be installed unless you have set apt-pinning or explicitly install a particular version.






                            share|improve this answer













                            This is a little more accurate:



                            apt-cache show <packagename> | grep "Version:"


                            The newest version will typically be installed unless you have set apt-pinning or explicitly install a particular version.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 15 '15 at 6:02









                            mchidmchid

                            23.4k25286




                            23.4k25286






























                                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%2f8560%2fhow-do-i-find-out-which-repository-a-package-comes-from%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

                                Human spaceflight

                                Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                                File:DeusFollowingSea.jpg