If an application is available in multiple repositories added in either /etc/apt/sources.list or /etc/apt/sources.list.d/ or any other way, how does sudo apt install determine which repository to use?
Is there some searching order between the added repositories?
Thanks.
sources.list.dare processed in lexical order, and thatsources.listtakes priority over all of those? The source.list man-page seems to be silent on this. – NickBroon Jun 25 '21 at 11:04ReadMainList()in the APT source code; it reads the mainsources.listfile first, then any files insources.list.d, sorted in lexical order (thetrueflag in the call toGetListOfFilesInDir()requests a sorted list). – Stephen Kitt Jun 28 '21 at 07:45