How does apt-get deal with multiple sources?

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











up vote
7
down vote

favorite
4












Let's say Ubuntu's repositories features a package.



I install that package using apt-get.



I then add an additional source (with add-apt-repository) that lists either a newer or older version of the package.



Will apt-get always upgrade to the latest version, regardless of which source offers the latest version?










share|improve this question

























    up vote
    7
    down vote

    favorite
    4












    Let's say Ubuntu's repositories features a package.



    I install that package using apt-get.



    I then add an additional source (with add-apt-repository) that lists either a newer or older version of the package.



    Will apt-get always upgrade to the latest version, regardless of which source offers the latest version?










    share|improve this question























      up vote
      7
      down vote

      favorite
      4









      up vote
      7
      down vote

      favorite
      4






      4





      Let's say Ubuntu's repositories features a package.



      I install that package using apt-get.



      I then add an additional source (with add-apt-repository) that lists either a newer or older version of the package.



      Will apt-get always upgrade to the latest version, regardless of which source offers the latest version?










      share|improve this question













      Let's say Ubuntu's repositories features a package.



      I install that package using apt-get.



      I then add an additional source (with add-apt-repository) that lists either a newer or older version of the package.



      Will apt-get always upgrade to the latest version, regardless of which source offers the latest version?







      package-management apt






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 16 '12 at 8:47









      eoinoc

      70661528




      70661528




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          8
          down vote



          accepted










          APT will always install the latest version that isn't excluded by preferences. Preferences are indicated in the file /etc/apt/preferences (and in files under /etc/apt/preferences.d).



          Some repositories have a configuration that prevents their packages from being installed automatically. For example, the Debian backports have release files (which you can see in /var/lib/apt/lists) that contain



          NotAutomatic: yes
          ButAutomaticUpgrades: yes


          If you have multiple sources for the exact same package (i.e. same package name, same version number), then APT downloads from the first source found in /etc/apt/sources.list (or /etc/apt/sources.list.d/*; the files are searched in lexicographic order, and the sources are searched in order inside each file). So list local mirrors first. The order in sources.list is irrelevant for packages that have a different version number.






          share|improve this answer






















          • so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
            – Sajuuk
            3 hours ago











          • @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
            – Gilles
            9 mins ago











          • I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
            – Sajuuk
            7 mins ago










          • @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
            – Gilles
            5 mins ago










          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%2f43165%2fhow-does-apt-get-deal-with-multiple-sources%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          8
          down vote



          accepted










          APT will always install the latest version that isn't excluded by preferences. Preferences are indicated in the file /etc/apt/preferences (and in files under /etc/apt/preferences.d).



          Some repositories have a configuration that prevents their packages from being installed automatically. For example, the Debian backports have release files (which you can see in /var/lib/apt/lists) that contain



          NotAutomatic: yes
          ButAutomaticUpgrades: yes


          If you have multiple sources for the exact same package (i.e. same package name, same version number), then APT downloads from the first source found in /etc/apt/sources.list (or /etc/apt/sources.list.d/*; the files are searched in lexicographic order, and the sources are searched in order inside each file). So list local mirrors first. The order in sources.list is irrelevant for packages that have a different version number.






          share|improve this answer






















          • so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
            – Sajuuk
            3 hours ago











          • @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
            – Gilles
            9 mins ago











          • I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
            – Sajuuk
            7 mins ago










          • @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
            – Gilles
            5 mins ago














          up vote
          8
          down vote



          accepted










          APT will always install the latest version that isn't excluded by preferences. Preferences are indicated in the file /etc/apt/preferences (and in files under /etc/apt/preferences.d).



          Some repositories have a configuration that prevents their packages from being installed automatically. For example, the Debian backports have release files (which you can see in /var/lib/apt/lists) that contain



          NotAutomatic: yes
          ButAutomaticUpgrades: yes


          If you have multiple sources for the exact same package (i.e. same package name, same version number), then APT downloads from the first source found in /etc/apt/sources.list (or /etc/apt/sources.list.d/*; the files are searched in lexicographic order, and the sources are searched in order inside each file). So list local mirrors first. The order in sources.list is irrelevant for packages that have a different version number.






          share|improve this answer






















          • so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
            – Sajuuk
            3 hours ago











          • @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
            – Gilles
            9 mins ago











          • I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
            – Sajuuk
            7 mins ago










          • @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
            – Gilles
            5 mins ago












          up vote
          8
          down vote



          accepted







          up vote
          8
          down vote



          accepted






          APT will always install the latest version that isn't excluded by preferences. Preferences are indicated in the file /etc/apt/preferences (and in files under /etc/apt/preferences.d).



          Some repositories have a configuration that prevents their packages from being installed automatically. For example, the Debian backports have release files (which you can see in /var/lib/apt/lists) that contain



          NotAutomatic: yes
          ButAutomaticUpgrades: yes


          If you have multiple sources for the exact same package (i.e. same package name, same version number), then APT downloads from the first source found in /etc/apt/sources.list (or /etc/apt/sources.list.d/*; the files are searched in lexicographic order, and the sources are searched in order inside each file). So list local mirrors first. The order in sources.list is irrelevant for packages that have a different version number.






          share|improve this answer














          APT will always install the latest version that isn't excluded by preferences. Preferences are indicated in the file /etc/apt/preferences (and in files under /etc/apt/preferences.d).



          Some repositories have a configuration that prevents their packages from being installed automatically. For example, the Debian backports have release files (which you can see in /var/lib/apt/lists) that contain



          NotAutomatic: yes
          ButAutomaticUpgrades: yes


          If you have multiple sources for the exact same package (i.e. same package name, same version number), then APT downloads from the first source found in /etc/apt/sources.list (or /etc/apt/sources.list.d/*; the files are searched in lexicographic order, and the sources are searched in order inside each file). So list local mirrors first. The order in sources.list is irrelevant for packages that have a different version number.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 mins ago

























          answered Jul 17 '12 at 21:50









          Gilles

          514k12110231550




          514k12110231550











          • so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
            – Sajuuk
            3 hours ago











          • @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
            – Gilles
            9 mins ago











          • I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
            – Sajuuk
            7 mins ago










          • @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
            – Gilles
            5 mins ago
















          • so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
            – Sajuuk
            3 hours ago











          • @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
            – Gilles
            9 mins ago











          • I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
            – Sajuuk
            7 mins ago










          • @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
            – Gilles
            5 mins ago















          so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
          – Sajuuk
          3 hours ago





          so for the exact same package (same name, same version number), apt will search in alphabetical order in sources.list.d (and it's sub directories)?
          – Sajuuk
          3 hours ago













          @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
          – Gilles
          9 mins ago





          @Sajuuk In sources.list first, then in the files in sources.list.d in alphabetical order. Inside each file, it searches in the order the sources are listed in the file.
          – Gilles
          9 mins ago













          I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
          – Sajuuk
          7 mins ago




          I know, because sources can exist in multiple location, such as /etc/apt/sources.list, and ./etc/apt/sources.list.d/*.list I'm asking in what order would those sources be searched?
          – Sajuuk
          7 mins ago












          @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
          – Gilles
          5 mins ago




          @Sajuuk See my edited comment (I'd pressed Enter before I'd finished typing it).
          – Gilles
          5 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f43165%2fhow-does-apt-get-deal-with-multiple-sources%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