pkg install: what is the "first" repository?

Matthew Seaman m.seaman at
Fri Jan 17 06:49:55 UTC 2014

On 17/01/2014 04:04, Matthew Pounsett wrote:
> From the pkg man page:
>      install
>              Install a package from a remote package repository.  If a package
>              is found in more than one remote repository, then installation
>              happens from the first one.  Downloading a package is tried from
>              each package repository in turn, until the package is success-
>              fully fetched.
> What is pkg's definition of "first"?  
> I have a single file in /usr/local/etc/pkg/repos/ which lists two
> local repositories.  'vim' exists in the first one in that file.  All
> of vim's dependencies are available from that repo.  Some of its
> dependencies exist in both, since they're required by things
> available from both repositories.
> For the dependencies that exist in both, pkg is trying to grab them
> from the second repository in that file.  I'm trying to figure out
> why, so I can make it stop.

'First' is just based on an alphabetical sort of the repo.conf files by
file name.  However, pkg(8) will generally look for the most recent
package available for any port, which will override that ordering

You can use 'pkg annotate' to force pkg(8) to always use a specific repo
for a particular port.  Details are in pkg-repository(5).

Note that there are changes in the pipeline which will make a
significant difference to the way pkg selects which repository to pull a
package from, as part of a complete revision of how dependency solving



Dr Matthew J Seaman MA, D.Phil.

JID: matthew at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list