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.d
are processed in lexical order, and thatsources.list
takes 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.list
file first, then any files insources.list.d
, sorted in lexical order (thetrue
flag in the call toGetListOfFilesInDir()
requests a sorted list). – Stephen Kitt Jun 28 '21 at 07:45