You are not logged in.

#1 2019-01-27 13:29:38

koesherbacon
Member
Registered: 2015-09-30
Posts: 7

How does pacman choose which repo to use when downloading & installing

Hello Arch forums,

I'm teaching myself the more advanced aspects of Arch and have though of a question regarding sofrware packages.  I have attempted to find the answer myself but I keep running into keyword problems describing my question. 

I'd like to know the following:
When a package is available on two or more repos, how does Arch choose which repo to use by defaults? Here's an example using 'yay' to search for 'google-chrome' with the repos archlinuxcn and condresrepo enabled.

$ yay google-chrome
3 condresrepo/google-chrome 71.0.3578.98-1 (55.4 MiB 193.0 MiB) 
    The popular and trusted web browser by Google (Stable Channel)
2 archlinuxcn/google-chrome-dev 73.0.3679.0-1 (57.4 MiB 199.0 MiB) 
    The popular and trusted web browser by Google (Dev Channel)
1 archlinuxcn/google-chrome 71.0.3578.98-1 (55.5 MiB 192.9 MiB) 
    The popular and trusted web browser by Google (Stable Channel)
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==> 

This is obviously a command that asks me to make a choice but when installing the same package with 'yay -S google-chrome' the package manager does the selection for me.


Since I don't want to use the deveolpment version, #1 and #3 are the only ones I care about.  I'm guessing that #1 will be picked as the source repo for the package because archlinuxcn is listed higher up in my /etc/pacman.conf than condresrepo.  Is my assumption correct?  If not, how do the standard package-managers pacman/yay/yaourt/etc choose which repo to use when installing a package contained within more than one?

I can't say I've ever run into a problem regarding which repo a certain package is coming from, I'm simply curious about how this works as I'm trying to become more proficient with Arch altogether.

Thanks!

Offline

#2 2019-01-27 13:53:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 6,230

Re: How does pacman choose which repo to use when downloading & installing

man pacman.conf wrote:

...
The order of repositories in the configuration files matters; repositories listed first will take precedence over those listed later in the file when packages in two repositories
       have identical names, regardless of version number.
...

Also there is only one standard package manager, and repository packages will in the end always be installed by pacman, whichever helper frontend you use here shouldn't factor in for repository packages.

Offline

#3 2019-01-27 13:57:23

hcjl
Member
From: berlin
Registered: 2007-06-29
Posts: 260

Re: How does pacman choose which repo to use when downloading & installing

For what reason did you add all those repos?

Offline

#4 2019-01-27 14:03:14

koesherbacon
Member
Registered: 2015-09-30
Posts: 7

Re: How does pacman choose which repo to use when downloading & installing

hcjl wrote:

For what reason did you add all those repos?

At the moment curiosity in the "Unofficial Repos" vs the AUR.  Sometimes I found that packages found in the AUR wouldn't work properly but did from another repo.

Offline

#5 2019-01-27 15:03:30

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,853

Re: How does pacman choose which repo to use when downloading & installing

koesherbacon wrote:

I'm guessing that #1 will be picked as the source repo for the package because archlinuxcn is listed higher up in my /etc/pacman.conf than condresrepo.  Is my assumption correct?  If not, how do the standard package-managers pacman/yay/yaourt/etc choose which repo to use when installing a package contained within more than one?

Since neither yay nor yaourt are standard at all, I don't understand your question.

As V1del said, pacman documents exactly how it chooses which package to choose -- but since google-chrome-dev != google-chrome (it merely provides it) you will never get offered this regardless of which repo comes first. Provides are only used for pacman -S, when there is not an exact pkgname match...

Whyever and however the yay/yaourt selection algorithms work is a question best asked of the yay/yaourt developers. I assume and hope that -Syu is modeled to respect how pacman itself operates. pacman does not have any option to not specify any options, so it seems yay has modeled your example after yaourt and introduced a mode of operation entirely foreign to pacman entirely.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2019-01-27 15:08:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 26,848
Website

Re: How does pacman choose which repo to use when downloading & installing

Moving to AUR Issues...


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#7 2019-01-27 18:21:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,079
Website

Re: How does pacman choose which repo to use when downloading & installing


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB