pkg.conf.5
1 .\" 2 .\" FreeBSD pkg - a next generation package for the installation and maintenance 3 .\" of non-core utilities. 4 .\" 5 .\" Copyright (c) 2025 The FreeBSD Project 6 .\" 7 .\" Redistribution and use in source and binary forms, with or without 8 .\" modification, are permitted provided that the following conditions 9 .\" are met: 10 .\" 1. Redistributions of source code must retain the above copyright 11 .\" notice, this list of conditions and the following disclaimer. 12 .\" 2. Redistributions in binary form must reproduce the above copyright 13 .\" notice, this list of conditions and the following disclaimer in the 14 .\" documentation and/or other materials provided with the distribution. 15 .\" 16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 .\" SUCH DAMAGE. 27 .\" 28 .\" @(#)pkg.1 29 .\" 30 .Dd March 11, 2026 31 .Dt PKG.CONF 5 32 .Os 33 .Sh NAME 34 .Nm "pkg.conf" 35 .Nd system-wide configuration file for 36 .Xr pkg 8 37 .Sh DESCRIPTION 38 .Nm 39 is the system-wide configuration file used by the 40 .Xr pkg 8 41 tools. 42 .Pp 43 The default location of this file is 44 .Pa /usr/local/etc/pkg.conf . 45 .Pp 46 Lines in the file beginning with a "#" are comments 47 and are ignored. 48 .Pp 49 The file is in UCL format. 50 For more information on the syntax of UCL, 51 please visit the official UCL website - http://github.com/vstakhov/libucl. 52 .Pp 53 The following types of options are recognized - 54 boolean, string and list options. 55 .Pp 56 A boolean option is marked as enabled if one of the following values is 57 specified in the configuration file - 58 .Dv YES, TRUE 59 and 60 .Dv ON . 61 .Sh OPTIONS 62 The following options can be defined in 63 .Nm : 64 .Bl -tag -width ".Cm ABI: string" 65 .It Cm ABI: string 66 The ABI of the package you want to install, for example 67 .Ql FreeBSD:14:amd64 . 68 This should be set in combination with the OSVERSION option if targeting 69 .Fx 70 to specify the exact target version. 71 Default: derived based on ABI_FILE. 72 .It Cm ABI_FILE: string 73 Set the file used to determine the target ABI. 74 Default: 75 .Pa /usr/bin/uname , 76 or if not found, 77 .Pa /bin/sh . 78 .It Cm ALIAS: key/value list 79 Define local aliases for various 80 .Xr pkg 8 81 standard command lines. 82 Whenever the 83 .Em key 84 text occurs as a separate 85 .Sq action 86 word in a command line of the form 87 .Nm pkg Em key ... , 88 substitute the 89 .Em value 90 text verbatim. 91 The replacement can consist of any sequence of text, which should form 92 a syntactically correct 93 .Xr pkg 8 94 command line when substituted in and followed by any remaining tokens from 95 the original command line. 96 Default: not set. 97 .It Cm AUTOCLEAN: boolean 98 Automatically cleanout the content of 99 .Em PKG_CACHEDIR 100 after each non dry-run call to 101 .Xr pkg-install 8 102 or 103 .Xr pkg-upgrade 8 . 104 Default: NO. 105 .It Cm AUTOREMOVE: boolean 106 Automatically remove orphaned packages after each non dry-run call to 107 .Xr pkg-install 8 , 108 .Xr pkg-delete 8 109 or 110 .Xr pkg-upgrade 8 . 111 This is equivalent to running 112 .Xr pkg-autoremove 8 113 after each operation. 114 Default: NO. 115 .It Cm DEFAULT_ALWAYS_YES: boolean 116 When this option is enabled 117 .Xr pkg 1 118 will default to "yes" for all questions 119 which require user confirmation before doing anything. 120 Default: NO. 121 .It Cm ASSUME_ALWAYS_YES: boolean 122 When this option is enabled 123 .Xr pkg 1 124 will automatically assume "yes" to all questions 125 which require user confirmation before doing anything, as if 126 the 127 .Fl y 128 flag was specified. 129 Default: NO. 130 .It Cm BACKUP_LIBRARIES: boolean 131 If set to 132 .Sy true 133 and if an upgrade will remove a library (typically due to the library version 134 number having been bumped), then 135 .Xr pkg 8 136 will back up the library to the path defined by 137 .Cm BACKUP_LIBRARY_PATH . 138 A package containing the backed up library will be created. 139 This package is named after the original package containing the library, with 140 the suffix 141 .Ql -backup-libraries 142 appended. 143 The package version will be bumped whenever an additional library is backed up. 144 Default: NO. 145 .It Cm BACKUP_LIBRARY_PATH: string 146 Path for library backups. 147 Default: 148 .Pa /usr/local/lib/compat/pkg . 149 .It Cm COMPRESSION_FORMAT: string 150 Set the default compression format: tzst, txz, tbz, tar. 151 Default: tzst. 152 .It Cm COMPRESSION_LEVEL: integer 153 Set the default compression level, special values are: 154 .Bl -tag -width "-1" 155 .It 0 156 default value per libarchive developers 157 .It -1 158 default value per pkg developers (default) 159 .El 160 .It Cm COMPRESSION_THREADS: integer 161 Set the number of threads to use during compression 162 (only functional for txz and tzst). 163 Default: -1 (automatic). 164 .It Cm CONSERVATIVE_UPGRADE: boolean 165 Ensure in multi repository mode that the priority is given as much as possible 166 to the repository where a package was first installed from. 167 Default: YES. 168 .It Cm CUDF_SOLVER: string 169 Experimental: tells pkg to use an external CUDF solver. 170 Default: not set. 171 .It Cm CASE_SENSITIVE_MATCH: boolean 172 Match package names or regular expressions given on the command line 173 against values in the database in a case sensitive way. 174 Default: YES. 175 .It Cm DEBUG_LEVEL: integer 176 Incremental values from 1 to 4 produce successively more verbose 177 debugging output. 178 A setting of 0 disables debugging output. 179 Overridden by the 180 .Fl d 181 command line option. 182 Default: 0. 183 .It Cm DEBUG_SCRIPTS: boolean 184 Activate debug mode for scripts (aka set -x) 185 Default: NO. 186 .It Cm DEVELOPER_MODE: boolean 187 Makes certain errors immediately fatal. 188 Adds various warnings and 189 suggestions to the output of 190 .Xr pkg 1 191 as an aid to port maintainers, including indicating when the port 192 might be marked as architecture independent. 193 Default: NO. 194 .It Cm DOT_FILE: string 195 When defined to a valid path, pkg will generate a 196 .Xr dot 1 197 file with the dependency graph of the concerned transaction. 198 .It Cm EVENT_PIPE: string 199 Send all event messages to the specified FIFO or Unix socket. 200 Events messages should be formatted as JSON. 201 Default: not set. 202 .It Cm FETCH_RETRY: integer 203 Number of times to retry a failed fetch of a file. 204 Default: 3. 205 .It Cm FETCH_TIMEOUT: integer 206 Maximum number of seconds to wait for any one file to download from the 207 network, either by SSH or any of the protocols supported by 208 .Xr libcurl 3 209 functions. 210 Default: 30. 211 .It Cm HANDLE_RC_SCRIPTS: boolean 212 When enabled, this option will automatically perform start/stop of 213 services during package installation and deinstallation. 214 Services are only started on installation if they are enabled in 215 .Pa /etc/rc.conf . 216 Default: NO. 217 .It Cm HTTP_USER_AGENT: string 218 Define User-agent to be sent to HTTP server when getting repository 219 data. 220 Default: pkg/<version>. 221 .It Cm IGNORE_OSVERSION: boolean [FreeBSD specific ] 222 Ignore 223 .Fx 224 OS version check, useful on -STABLE and -CURRENT branches. 225 Default: NO. 226 .It Cm INDEXDIR: string 227 If set, the directory to search for 228 .Cm INDEXFILE 229 in. 230 If unset, 231 .Cm PORTSDIR 232 will be searched instead. 233 Default: not set. 234 .It Cm INDEXFILE: string 235 The filename of the ports index, searched for in 236 .Cm INDEXDIR 237 or 238 .Cm PORTSDIR . 239 Default: INDEX-N where 240 .Cm N 241 is the OS major version number. 242 .It Cm IP_VERSION: integer 243 Restrict network access to specified IP version. 244 4 will only allow IPv4 and 6 will only allow IPv6. 245 Any other value will use the system default. 246 Repositories or command line options can override this setting. 247 Default: 0. 248 .It Cm LOCK_RETRIES: integer 249 Number of attempts to obtain a lock before giving up and exiting. 250 Default: 5. 251 .It Cm LOCK_WAIT: integer 252 Wait time in seconds to regain a lock if it is not available. 253 Default: 1. 254 .It Cm METALOG: string 255 If set, 256 .Xr pkg 8 257 will write a METALOG of the extracted files. 258 .It Cm NAMESERVER: string 259 Hostname or IPv4 or IPv6 address of name server to use for DNS 260 resolution, overriding the system defaults in 261 .Pa /etc/resolv.conf . 262 When given as a hostname, will be converted to a list of IPv4 or IPv6 263 addresses by the default mechanisms configured on the system. 264 See 265 .Xr getaddrinfo 3 . 266 .It Cm OSVERSION: integer 267 Specify the exact 268 .Fx 269 version for the target ABI. 270 This should be set in combination with the ABI option. 271 The format is the same as the format of 272 .Dv __FreeBSD_version 273 in 274 .Pa /usr/include/sys/param.h . 275 Default: derived based on ABI_FILE. 276 .It Cm PERMISSIVE: boolean 277 Ignore conflicts while registering a package. 278 Note that the conflicting files will not be recorded as owned by the new 279 package. 280 Default: NO. 281 .It Cm PKG_CACHEDIR: string 282 Specifies the cache directory for packages. 283 Default: 284 .Pa /var/cache/pkg . 285 .It Cm PKG_CREATE_VERBOSE: boolean 286 When set to a 287 .Sy true 288 value, make 289 .Xr pkg-create 8 290 use verbose mode as standard. 291 Default: 292 .Sy NO . 293 .It Cm PKG_DBDIR: string 294 Specifies the directory to use for storing the package 295 database files. 296 Default: 297 .Pa /var/db/pkg . 298 .It Cm PKG_ENABLE_PLUGINS: boolean 299 When set to 300 .Dq YES , 301 activate plugin support. 302 Default: YES. 303 .It Cm PKG_ENV: Key/Value list 304 This tells 305 .Xr pkg 8 306 to set key/values to be passed in the environment. 307 This allow setting variables to configure the http(s) fetcher. 308 Which accepts environment variables compatible with 309 .Xr fetch 3 , 310 e.g., 311 .Ev HTTP_PROXY . 312 Default: not set. 313 .It Cm PKG_PLUGINS_DIR: string 314 Directory which 315 .Xr pkg 8 316 will load plugins from. 317 Default: 318 .Pa /usr/local/lib/pkg . 319 .It Cm PKG_TRIGGERS_ENABLE: boolean 320 Enable or disable execution of triggers at the end of the transactions. 321 Default: YES. 322 .It Cm PKG_TRIGGERS_DIR: array 323 List of directories where triggers are stored. 324 Default: 325 .Pa /usr/share/pkg/triggers , 326 .Pa /usr/local/share/pkg/triggers . 327 .It Cm PKG_SSH_ARGS: string 328 Extra arguments to pass to 329 .Xr ssh 1 . 330 This is a global setting; it can be overridden on a per-repository basis 331 using the 332 .Cm SSH_ARGS 333 option in the repository configuration. 334 Default: not set. 335 .It Cm PLIST_KEYWORDS_DIR: string 336 Directory containing definitions of plist keywords. 337 Default: PORTSDIR/keyword. 338 .It Cm PLUGINS: array 339 List of plugins that 340 .Xr pkg 8 341 should load. 342 Default: not set. 343 .It Cm PLUGINS_CONF_DIR: string 344 Directory containing per-plugin configuration files. 345 Default: 346 .Pa /usr/local/etc/pkg . 347 .It Cm PORTSDIR: string 348 Specifies the location to the Ports directory. 349 Default: 350 .Pa /usr/ports . 351 .It Cm READ_LOCK: boolean 352 Use read locking for query database. 353 Default: NO. 354 .It Cm REPOS_DIR: array 355 List of directories to search for repository configuration files. 356 Default: 357 .Pa /etc/pkg/ , 358 .Pa /usr/local/etc/pkg/repos/ . 359 .It Cm REPO_AUTOUPDATE: boolean 360 When true, automatically check for and download updates to 361 .Pa /var/db/pkg/repo.sqlite 362 when running one of: 363 .Nm pkg fetch , 364 .Nm pkg install , 365 .Nm pkg rquery , 366 .Nm pkg search , 367 .Nm pkg upgrade , 368 or 369 .Nm pkg version -R . 370 Default: YES. 371 .It Cm RUN_SCRIPTS: boolean 372 Run pre-/post-installation action scripts. 373 Default: YES. 374 .It Cm SAT_SOLVER: string 375 Experimental: tells pkg to use an external SAT solver. 376 Default: not set. 377 .It Cm SQLITE_PROFILE: boolean 378 Profile SQLite queries. 379 Default: NO. 380 .It Cm SSH_RESTRICT_DIR: string 381 Directory which the ssh subsystem will be restricted to. 382 Default: not set. 383 .It Cm SYSLOG: boolean 384 Log all of the installation/deinstallation/upgrade operations via 385 .Xr syslog 3 . 386 Default: YES. 387 .It Cm UNSET_TIMESTAMP: boolean 388 Do not include timestamps in the package 389 .Xr tar 1 390 archive. 391 Normally, timestamps are copied from the staging directory the 392 package is created from. 393 Default: NO. 394 .It Cm VERSION_SOURCE: string 395 Default database for comparing version numbers in 396 .Xr pkg-version 8 . 397 Valid values are 398 .Sy I 399 for index, 400 .Sy P 401 for ports, 402 .Sy R 403 for remote. 404 Default: If unset, the algorithm described in 405 .Xr pkg-version 8 406 is used to determine the version source automatically. 407 .It Cm VALID_URL_SCHEME: array 408 List of url schemes that pkg can accept while parsing the repository 409 configuration file. 410 Default: pkg+http, pkg+https, https, http, file, ssh, tcp. 411 .It Cm VULNXML_SITE: string 412 Specifies the URL to fetch the 413 .Pa vuln.xml 414 vulnerability database from. 415 Default: 416 .Pa https://vuxml.freebsd.org/freebsd/vuln.xml.xz . 417 .It Cm WARN_SIZE_LIMIT: integer 418 When download and total change is less than than this option, don't ask 419 the user to confirm the desired action. 420 Default: 421 .Sy 1048576 422 .Pq 1MB . 423 .It Cm WORKERS_COUNT: integer 424 How many workers are used for pkg-repo. 425 If set to 0, 426 .Va hw.ncpu 427 is used. 428 Default: 0. 429 .It Cm PKG_REINSTALL_ON_OPTIONS_CHANGE: boolean 430 Reinstall packages if options changed between the local version and the 431 remote version. 432 Default: YES. 433 .It Cm AUTOMERGE: boolean 434 When enabled, automatically attempt to merge configuration files 435 during package upgrades. 436 Default: YES. 437 .It Cm MERGETOOL: string 438 Specifies an external tool command to use for merging configuration 439 files during package upgrades. 440 Used in conjunction with 441 .Cm AUTOMERGE . 442 Default: not set. 443 .It Cm FORCE_CAN_REMOVE_VITAL: boolean 444 When true, the 445 .Fl f 446 (force) flag is allowed to override the protection on vital packages, 447 allowing them to be removed. 448 Default: YES. 449 .It Cm DEBUG_SCHEDULER_DOT_FILE: string 450 When defined to a valid path, pkg will generate a 451 .Xr dot 1 452 file with the dependency graph of the internal scheduler. 453 Similar to 454 .Cm DOT_FILE 455 but specifically for the job scheduler. 456 Default: not set. 457 .It Cm REPOSITORIES: object 458 Allows defining repositories directly within 459 .Nm 460 rather than in separate repository configuration files. 461 Default: not set. 462 .It Cm AUDIT_IGNORE_GLOB: array 463 A list of glob patterns for package names to ignore during 464 .Xr pkg-audit 8 . 465 Packages matching any of these patterns will be excluded 466 from vulnerability checks. 467 Default: not set. 468 .It Cm AUDIT_IGNORE_REGEX: array 469 A list of regular expressions for package names to ignore during 470 .Xr pkg-audit 8 . 471 Packages matching any of these patterns will be excluded 472 from vulnerability checks. 473 Default: not set. 474 .It Cm REPO_ACCEPT_LEGACY_PKG: boolean 475 When true, allows pkg to accept packages in the legacy package format 476 from repositories. 477 Default: NO. 478 .It Cm FILES_IGNORE_GLOB: array 479 A list of glob patterns for files to ignore during package 480 installation and registration. 481 Files matching these patterns will be skipped. 482 Default: not set. 483 .It Cm FILES_IGNORE_REGEX: array 484 A list of regular expressions for files to ignore during package 485 installation and registration. 486 Files matching these patterns will be skipped. 487 Default: not set. 488 .It Cm SHLIB_PROVIDE_PATHS_NATIVE: array 489 List of absolute paths where native shared libraries are provided. 490 Used to filter which shared libraries a package provides 491 based on path. 492 Default: not set. 493 .It Cm SHLIB_PROVIDE_PATHS_COMPAT_32: array 494 List of absolute paths where 32-bit compatibility shared libraries 495 are provided. 496 Default: not set. 497 .It Cm SHLIB_PROVIDE_PATHS_COMPAT_LINUX: array 498 List of absolute paths where Linux compatibility shared libraries 499 are provided. 500 Default: not set. 501 .It Cm SHLIB_PROVIDE_PATHS_COMPAT_LINUX_32: array 502 List of absolute paths where 32-bit Linux compatibility shared 503 libraries are provided. 504 Default: not set. 505 .It Cm SHLIB_PROVIDE_IGNORE_GLOB: array 506 List of glob patterns to ignore when computing shared libraries 507 provided by a package. 508 Default: not set. 509 .It Cm SHLIB_PROVIDE_IGNORE_REGEX: array 510 List of regular expressions to ignore when computing shared libraries 511 provided by a package. 512 Default: not set. 513 .It Cm SHLIB_REQUIRE_IGNORE_GLOB: array 514 List of glob patterns to ignore when computing shared libraries 515 required by a package. 516 Default: not set. 517 .It Cm SHLIB_REQUIRE_IGNORE_REGEX: array 518 List of regular expressions to ignore when computing shared libraries 519 required by a package. 520 Default: not set. 521 .It Cm PKG_DEBUG_FLAGS: array 522 Controls which debug subsystems produce output. 523 Default: all. 524 .It Cm TRACK_LINUX_COMPAT_SHLIBS: boolean 525 When enabled, pkg tracks Linux compatibility shared libraries. 526 Default: NO. 527 .El 528 .Sh REPOSITORY CONFIGURATION 529 To use a repository you will need at least one repository 530 configuration file. 531 .Pp 532 Repository configuration files are searched for in order of the 533 directories listed in the 534 .Cm REPOS_DIR 535 array, 536 which defaults to 537 .Pa /etc/pkg/ 538 and 539 .Pa /usr/local/etc/pkg/repos/ . 540 .Pp 541 Filenames are arbitrary, but should end in 542 .Sq .conf . 543 For example 544 .Pa /usr/local/etc/pkg/repos/myrepo.conf . 545 .Pp 546 A repository file is in UCL format and has the following form: 547 .Bl -tag -width ".Cm myrepo:" 548 .It Cm myrepo : 549 .Bl -tag -width ".Cm MIRROR_TYPE: string" 550 .It Cm ENV: object 551 A list of key value entries that will be passed as environment variable 552 for the bundled 553 .Xr fetch 3 , 554 per repository. 555 .It Cm URL: string 556 URL for this repository only. 557 .It Cm ENABLED: boolean 558 The repository will be used only if this option is enabled. 559 Default: YES. 560 .It Cm MIRROR_TYPE: string 561 MIRROR_TYPE for this repository only. 562 Default: NONE. 563 Any of 564 .Dv HTTP 565 or 566 .Dv SRV 567 or 568 .Dv NONE . 569 .It Cm SIGNATURE_TYPE: string 570 Specifies what type of signature this repository uses. 571 Can be one of 572 .Dv NONE , 573 .Dv PUBKEY or 574 .Dv FINGERPRINTS . 575 (default: NONE) 576 .It Cm PUBKEY: string 577 This should be set to a path containing public key for this repository 578 only. (default: NONE) 579 .It Cm FINGERPRINTS: string 580 This should be set to a path containing known signatures for the repository. 581 .It Cm IP_VERSION: integer 582 Restrict network access to specified IP version. 583 4 will only allow IPv4 and 6 will only allow IPv6. 584 Any other value will use the system default. 585 This option overrides the global setting with the same name and can be 586 overwritten by a command line option. 587 Default: 0. 588 .It Cm PRIORITY: integer 589 Set the priority of the repository. 590 Higher values are preferred. 591 Default: 0. 592 .It Cm SSH_ARGS: string 593 Extra arguments to pass to 594 .Xr ssh 1 595 when fetching from this repository. 596 This overrides the global 597 .Cm PKG_SSH_ARGS 598 setting for this repository only. 599 Useful for specifying a private key or connection options on a 600 per-repository basis. 601 Default: not set. 602 .El 603 .El 604 .Pp 605 For a 606 .Cm MIRROR_TYPE 607 of 608 .Dv NONE , 609 any of the following URL schemes: 610 .Dv http:// , 611 .Dv https:// , 612 .Dv file:// , 613 .Dv ssh:// , 614 .Dv tcp:// . 615 Where 616 .Sy MIRROR_TYPE 617 is 618 .Dv SRV , 619 you should use a 620 .Dv pkg+http:// 621 or 622 .Dv pkg+https:// 623 (etc.) URL scheme. 624 Using an 625 .Dv http:// 626 URL implies that the hostname part is a simple hostname according to 627 RFC 2616, and is no longer accepted. 628 .Pp 629 When 630 .Sy SIGNATURE_TYPE 631 is 632 .Dv NONE , 633 then no signature checking will be done on the repository. 634 When 635 .Sy SIGNATURE_TYPE 636 is 637 .Dv PUBKEY , 638 then the 639 .Sy PUBKEY 640 option will be used for signature verification. 641 This option is for use with the built-in signing support. 642 When 643 .Sy SIGNATURE_TYPE 644 is 645 .Dv FINGERPRINTS , 646 then the 647 .Sy FINGERPRINTS 648 option will be used for signature verification. 649 This option is for use with an external signing command. 650 See 651 .Xr pkg-repo 8 652 for more discussion on signature types. 653 .Pp 654 If 655 .Sy FINGERPRINTS 656 is set to 657 .Pa /usr/local/etc/pkg/fingerprints/myrepo , 658 then the directories 659 .Pa /usr/local/etc/pkg/fingerprints/myrepo/trusted 660 and 661 .Pa /usr/local/etc/pkg/fingerprints/myrepo/revoked 662 should exist with known good and bad fingerprints, respectively. 663 Files in those directories should be in the format: 664 .Bd -literal -offset indent 665 function: sha256 666 fingerprint: sha256_representation_of_the_public_key 667 .Ed 668 .Pp 669 The repository tag 670 .Fa myrepo 671 is an arbitrary string. 672 Reusing the repository tag will cause those items defined in 673 configuration files later on the 674 .Sy REPOS_DIR 675 search path to overwrite the equivalent settings for the same tag 676 earlier on the search path. 677 Hence the very common idiom, used to turn off the default 678 .Cm FreeBSD 679 configuration shipped in 680 .Pa /etc/pkg/FreeBSD.conf . 681 Rather than editing that file directly, create 682 .Pa /usr/local/etc/pkg/repos/FreeBSD.conf 683 with this content: 684 .Bd -literal -offset indent 685 FreeBSD: { enabled: NO } 686 .Ed 687 .Pp 688 Repositories are processed in the order they are found on the 689 .Sy REPOS_DIR 690 search path, with individual repository configuration files in the 691 same directory processed in alphabetical order. 692 Settings from files later in the search path will override those from 693 earlier ones. 694 Packages are selected preferentially out of all the repositories that contain 695 them from the repository with the highest priority, so long as they are 696 suitable to solve the necessary dependency requirements. 697 However, this preference may be overruled when 698 .Sy CONSERVATIVE_UPGRADE 699 is set to 700 .Dv true , 701 in which case a package will as far as possible always be upgraded from the 702 same repository the older installed version came from, as given in the 703 .Sy repository 704 annotation of the installed package. 705 See 706 .Xr pkg-repository 5 707 for details. 708 .Pp 709 It is possible to specify more than one repository per file. 710 .Sh VARIABLES 711 The following variables will be expanded during the parsing of 712 .Nm . 713 .Bl -tag -width Ds 714 .It Va ABI 715 Expands to the ABI string 716 .Po e.g. 717 .Ql FreeBSD:14:amd64 718 .Pc . 719 .It Va OSNAME 720 Expands to the the name of the target operating system. 721 .It Va RELEASE 722 Expands to the full version of the target operating system. 723 .It Va VERSION_MAJOR 724 Expands to the major version of the target operating system. 725 .It Va VERSION_MINOR 726 Expands to the minor version of the target operating system. 727 .It Va OSVERSION 728 If targeting 729 .Fx , 730 expands to the target version in the same format as 731 .Dv __FreeBSD_version 732 in 733 .Pa /usr/include/sys/param.h . 734 .It Va ARCH 735 Expands to the architecture of the system. 736 .El 737 .Pp 738 Since the values of these variables are affected by some options that 739 may be set in 740 .Nm 741 (for example ABI or ABI_FILE), it is necessary to parse pkg.conf in two 742 passes. 743 The first pass only parses the ABI, ABI_FILE, and OSVERSION 744 options and does no variable expansion. 745 The second pass expands the 746 variables listed above and ignores the ABI, ABI_FILE, and OSVERSION 747 options. 748 .Sh ENVIRONMENT 749 An environment variable with the same name as the option in the 750 configuration file always overrides the value of an option set in the 751 file. 752 .Sh EXAMPLES 753 .Fx 754 latest ports repository configuration: 755 .Bd -literal -offset indent 756 FreeBSD-ports: { 757 url: "pkg+https://pkg.freebsd.org/${ABI}/latest", 758 enabled: true, 759 signature_type: "fingerprints", 760 fingerprints: "/usr/share/keys/pkg", 761 mirror_type: "srv" 762 } 763 .Ed 764 .Pp 765 .Fx 766 latest base repository configuration: 767 .Bd -literal -offset indent 768 FreeBSD-base: { 769 url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_latest", 770 enabled: true, 771 signature_type: "fingerprints", 772 fingerprints: "/usr/share/keys/pkg", 773 mirror_type: "srv" 774 } 775 .Ed 776 .Pp 777 .Fx 778 quarterly kernel modules repository configuration: 779 .Bd -literal -offset indent 780 FreeBSD-ports-kmods: { 781 url: "pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly_${VERSION_MINOR}", 782 enabled: true, 783 signature_type: "fingerprints", 784 fingerprints: "/usr/share/keys/pkg", 785 mirror_type: "srv" 786 } 787 .Ed 788 .Pp 789 Example for pkg.conf: 790 .Bd -literal -offset indent 791 pkg_dbdir: "/var/db/pkg" 792 pkg_cachedir: "/var/cache/pkg" 793 portsdir: "/usr/ports" 794 handle_rc_scripts: false 795 assume_always_yes: false 796 repos_dir: [ 797 "/etc/pkg", 798 "/usr/local/etc/pkg/repos", 799 ] 800 syslog: true 801 developer_mode: false 802 pkg_env: { 803 http_proxy: "http://myproxy:3128", 804 } 805 alias: { 806 origin: "info -qo", 807 nonauto: "query -e '%a == 0' '%n-%v'" 808 } 809 .Ed 810 .Pp 811 To bootstrap 812 .Xr pkg 8 813 using a private repository (Assuming a 814 .Xr pkg 7 815 new enough to support the 816 .Cm bootstrap 817 command.): 818 .Bd -literal -offset indent 819 # cat > /usr/local/etc/pkg/repos/example.conf <<EOF 820 example: { 821 url: http://pkgrepo.example.com/${ABI} 822 } 823 EOF 824 # cat > /usr/local/etc/pkg/repos/FreeBSD.conf <<EOF 825 FreeBSD: { 826 enabled: NO 827 } 828 EOF 829 # env PACKAGESITE='http://pkgrepo.example.com/${ABI}' \ 830 /usr/sbin/pkg bootstrap 831 .Ed 832 .Pp 833 Note that 834 .Xr pkg 7 835 uses 836 .Ev PACKAGESITE 837 for the URL to download 838 .Xr pkg 8 839 from, and subsequently passes it in the environment to 840 .Xr pkg-static 8 , 841 which ignores it (possibly with a deprecation warning that should be 842 ignored), and reads the configuration files instead. 843 .Sh SEE ALSO 844 .Xr pkg_create 3 , 845 .Xr pkg_printf 3 , 846 .Xr pkg_repo_create 3 , 847 .Xr pkg_repos 3 , 848 .Xr pkg-keywords 5 , 849 .Xr pkg-lua-script 5 , 850 .Xr pkg-repository 5 , 851 .Xr pkg-script 5 , 852 .Xr pkg-triggers 5 , 853 .Xr pkg 8 , 854 .Xr pkg-add 8 , 855 .Xr pkg-alias 8 , 856 .Xr pkg-annotate 8 , 857 .Xr pkg-audit 8 , 858 .Xr pkg-autoremove 8 , 859 .Xr pkg-check 8 , 860 .Xr pkg-clean 8 , 861 .Xr pkg-config 8 , 862 .Xr pkg-create 8 , 863 .Xr pkg-delete 8 , 864 .Xr pkg-fetch 8 , 865 .Xr pkg-help 8 , 866 .Xr pkg-info 8 , 867 .Xr pkg-install 8 , 868 .Xr pkg-key 8 , 869 .Xr pkg-lock 8 , 870 .Xr pkg-plugins 8 , 871 .Xr pkg-query 8 , 872 .Xr pkg-register 8 , 873 .Xr pkg-repo 8 , 874 .Xr pkg-repositories 8 , 875 .Xr pkg-rquery 8 , 876 .Xr pkg-search 8 , 877 .Xr pkg-set 8 , 878 .Xr pkg-shell 8 , 879 .Xr pkg-shlib 8 , 880 .Xr pkg-ssh 8 , 881 .Xr pkg-stats 8 , 882 .Xr pkg-triggers 8 , 883 .Xr pkg-unregister 8 , 884 .Xr pkg-update 8 , 885 .Xr pkg-updating 8 , 886 .Xr pkg-upgrade 8 , 887 .Xr pkg-version 8 , 888 .Xr pkg-which 8