|  | 
   
 |   |  |   
  
    | PKG.CONF(5) | FreeBSD File Formats Manual | PKG.CONF(5) |  
pkg.conf—
    system-wide configuration file for
    pkg(8)
 pkg.confis the system-wide configuration
    file used by the
    pkg(8)
    tools.
 The default location of this file is
    /usr/local/etc/pkg.conf. Lines in the file beginning with a "#" are comments and
    are ignored. The file is in UCL format. For more information on the syntax of
    UCL, please visit the official UCL website -
    http://github.com/vstakhov/libucl. The following types of options are recognized - boolean, string
    and list options. A boolean option is marked as enabled if one of the following
    values is specified in the configuration file - YES,
    TRUEandON. The following options can be defined in
    pkg.conf: 
  ABI:
    stringThe ABI of the package you want to install, for example
      ‘FreeBSD:14:amd64’. This should be
      set in combination with the OSVERSION option if targeting
      FreeBSD to specify the exact target version.
      Default: derived based on ABI_FILE.ABI_FILE:
    stringSet the file used to determine the target ABI. Default:
      /usr/bin/uname, or if not found,
      /bin/sh.ALIAS:
    key/value listDefine local aliases for various
      pkg(8)
      standard command lines. Whenever the key text occurs as
      a separate ‘action’ word in a command line of the form
      pkgkey ..., substitute the
      value
      text verbatim. The replacement can consist of any sequence of text, which
      should form a syntactically correct
      pkg(8)
      command line when substituted in and followed by any remaining tokens from
      the original command line. Default: not set.ARCHIVE_SYMLINK:
    booleanWhen creating a package, create a symlink to it using the legacy
      extension, this is a backward compatibility option, default: trueAUTOCLEAN:
    booleanAutomatically cleanout the content of
      PKG_CACHEDIR
      after each non dry-run call to
      pkg-install(8)
      or
      pkg-upgrade(8).DEFAULT_ALWAYS_YES:
    booleanWhen this option is enabled
      pkg(1)
      will default to "yes" for all questions which require user
      confirmation before doing anything. Default: NO.ASSUME_ALWAYS_YES:
    booleanWhen this option is enabled
      pkg(1)
      will automatically assume "yes" to all questions which require
      user confirmation before doing anything, as if it the
      -yflag was specified. Default: NO.BACKUP_LIBRARIES:
    booleanIf set to true
      pkg(8)
      will backup ancient libraries if they are removed as the result of an
      upgrade and keep a copy in the path define in
      BACKUP_LIBRARY_PATH. If it does not exist yet a
      new package "compat-libraries" will be created. the version will
      be bumped each time a new library is backed up Default: NO.BACKUP_LIBRARY_PATH:
    stringLocation where the libraries are backed up. Default:
      /usr/local/lib/compat/pkg.COMPRESSION_FORMAT:
    stringSet the default compression format: tzst, txz (default), tbz, tar.
      Default: per pkg developers.COMPRESSION_LEVEL:
    integerSet the default compression level, special values are:
    
      0 default value per libarchive developers -1 default value per pkg developers (default) COMPRESSION_THREADS:
    integerSet the number of threads to use during compression (only functional for
      txz and tzst)CONSERVATIVE_UPGRADE:
    booleanEnsure in multi repository mode that the priority is given as much as
      possible to the repository where a package was first installed from.
      Default: YES.CUDF_SOLVER:
    stringExperimental: tells pkg to use an external CUDF solver. Default: not
    set.CASE_SENSITIVE_MATCH:
    booleanMatch package names or regular expressions given on the command line
      against values in the database in a case sensitive way. Default: NO.DEBUG_LEVEL:
    integerIncremental values from 1 to 4 produce successively more verbose debugging
      output. A setting of 0 disables debugging output. Overridden by the
      -dcommand line option. Default: 0.DEBUG_SCRIPTS:
    booleanActivate debug mode for scripts (aka set -x) Default: NO.DEVELOPER_MODE:
    booleanMakes certain errors immediately fatal. Adds various warnings and
      suggestions to the output of
      pkg(1)
      as an aid to port maintainers, including indicating when the port might be
      marked as architecture independent. Default: NO.DOT_FILE:
    stringWhen defined to a valid path, pkg will generate a
      dot(1)
      file with the dependency graph of the concerned transaction.EVENT_PIPE:
    stringSend all event messages to the specified FIFO or Unix socket. Events
      messages should be formatted as JSON. Default: not set.FETCH_RETRY:
    integerNumber of times to retry a failed fetch of a file. Default: 3.FETCH_TIMEOUT:
    integerMaximum number of seconds to wait for any one file to download from the
      network, either by SSH or any of the protocols supported by
      fetch(3)
      functions. Default: 30.HANDLE_RC_SCRIPTS:
    booleanWhen enabled, this option will automatically perform start/stop of
      services during package installation and deinstallation. Services are only
      started on installation if they are enabled in
      /etc/rc.conf. Default: NO.HTTP_USER_AGENT:
    stringDefine User-agent to be sent to HTTP server when getting repository
    data.IGNORE_OSVERSION:
    boolean [FreeBSD specific]Ignore FreeBSD OS version check, useful on -STABLE and -CURRENT branches.
      Default: NO.INDEXDIR:
    stringIf set, the directory to search for INDEXFILEin.
      If unset,PORTSDIRwill be searched instead.
      Default: not set.INDEXFILE:
    stringThe filename of the ports index, searched for in
      INDEXDIRorPORTSDIR.
      Default: INDEX-N whereNis the OS major version
      number.IP_VERSION:
    integerRestrict network access to specified IP version. 4 will only allow IPv4
      and 6 will only allow IPv6. Any other value will use the system default.
      Repositories or command line options can override this setting. Default:
      0.LOCK_RETRIES:
    integerNumber of attempts to obtain a lock before giving up and exiting. Default:
      5.LOCK_WAIT:
    integerWait time in seconds to regain a lock if it is not available. Default:
    1.METALOG:
    stringIf set,
      pkg(8)
      will write a METALOG of the extracted files.NAMESERVER:
    stringHostname or IPv4 or IPv6 address of name server to use for DNS resolution,
      overriding the system defaults in
      /etc/resolv.conf. When given as a hostname, will
      be converted to a list of IPv4 or IPv6 addresses by the default mechanisms
      configured on the system. See
      getaddrinfo(3).OSVERSION:
    integerSpecifiy the exact FreeBSD version for the target
      ABI. This should be set in combination with the ABI option. The format is
      the same as the format of __FreeBSD_versionin
      /usr/include/sys/param.h. Default: derived based
      on ABI_FILE.PERMISSIVE:
    booleanIgnore conflicts while registering a package. Note that the conflicting
      files will not be recorded as owned by the new package. Default: NO.PKG_CACHEDIR:
    stringSpecifies the cache directory for packages. Default:
      /var/cache/pkg.PKG_CREATE_VERBOSE:
    booleanWhen set to a true value, make
      pkg-create(8)
      use verbose mode as standard. Default:
      NO.PKG_DBDIR:
    stringSpecifies the directory to use for storing the package database files.
      Default: /var/db/pkg.PKG_ENABLE_PLUGINS:
    booleanWhen set to “YES”, activate plugin support. Default:
    YES.PKG_ENV:
    Key/Value listThis tells
      pkg(8)
      to set key/values to be passed in the environment. This allow setting
      variables to configure the http(s) fetcher. Which accepts environment
      variables compatible with
      fetch(3),
      e.g., HTTP_PROXY. Default: not set.PKG_PLUGINS_DIR:
    stringDirectory which
      pkg(8)
      will load plugins from. Default:
      /usr/local/lib/pkg.PKG_TRIGGERS_ENABLEEnable or disable execution of triggers at the end of the transactions.
      Default: YES.PKG_TRIGGERS_DIRDirectory where the triggers are stored Default:
      /usr/local/share/pkg/triggers.PKG_SSH_ARGS:
    stringExtra arguments to pass to
      ssh(1).
      Default: not set.PLIST_KEYWORDS_DIR:
    stringDirectory containing definitions of plist keywords. Default:
      PORTSDIR/keyword.PLUGINS:
    arrayList of plugins that
      pkg(8)
      should load. Default: not set.PLUGINS_CONF_DIR:
    stringDirectory containing per-plugin configuration files. Default:
      /usr/local/etc/pkg.PORTSDIR:
    stringSpecifies the location to the Ports directory. Default:
      /usr/ports.READ_LOCK:
    booleanUse read locking for query database. Default: NO.REPOS_DIR:
    arrayList of directories to search for repository configuration files. Default:
      /etc/pkg/,
      /usr/local/etc/pkg/repos/.REPO_AUTOUPDATE:
    booleanWhen true, automatically check for and download updates to
      /var/db/pkg/repo.sqlite when running one of:
      pkg fetch,pkg install,pkg rquery,pkg search,pkg upgrade, orpkg version
      -R. Default: YES.RUN_SCRIPTS:
    booleanRun pre-/post-installation action scripts. Default: YES.SAT_SOLVER:
    stringExperimental: tells pkg to use an external SAT solver. Default: not
    set.SQLITE_PROFILE:
    booleanProfile SQLite queries. Default: NO.SSH_RESTRICT_DIR:
    stringDirectory which the ssh subsystem will be restricted to. Default: not
    set.SYSLOG:
    booleanLog all of the installation/deinstallation/upgrade operations via
      syslog(3).
      Default: YES.UNSET_TIMESTAMP:
    booleanDo not include timestamps in the package
      tar(1)
      archive. Normally, timestamps are copied from the staging directory the
      package is created from. Default: NO.VERSION_SOURCE:
    stringDefault database for comparing version numbers in
      pkg-version(8).
      Valid values are
      I for index,
      P for ports,
      R for remote.
      Default: If unset, the algorithm described in
      pkg-version(8)
      is used to determine the version source automatically.VALID_URL_SCHEMEList of url scheme that pkg can accept while parsing the repository
      confguration file.VULNXML_SITE:
    stringSpecifies the URL to fetch the vuln.xml
      vulnerability database from. Default:
      http://vuxml.freebsd.org/freebsd/vuln.xml.xz.WARN_SIZE_LIMIT:
    integerWhen download and total change is less than than this option, don't ask
      the user to confirm the desired action. Default:
      1048576
      (1MB).WORKERS_COUNT:
    integerHow many workers are used for pkg-repo. If set to 0,
      hw.ncpu is used. Default: 0.PKG_REINSTALL_ON_OPTIONS_CHANGEReinstall packages if options changed between the local version and the
      remote version. Default: true To use a repository you will need at least one repository
    configuration file. Repository configuration files are searched for in order of the
    directories listed in the REPOS_DIRarray, which
    defaults to /etc/pkg/ and
    /usr/local/etc/pkg/repos/. Filenames are arbitrary, but should end in ‘.conf’.
    For example
  /usr/local/etc/pkg/repos/myrepo.conf. A repository file is in UCL format and has the following form: 
  myrepo:
    
      ENV:
        objectA list of key value entries that will be passed as environment
          variable for the bundled
          fetch(3),
          per repository.URL:
        stringURL for this repository only.ENABLED:
        booleanThe repository will be used only if this option is enabled. Default:
          YES.MIRROR_TYPE:
        stringMIRROR_TYPE for this repository only. Default: NONE. Any of
          HTTPorSRVorNONE.SIGNATURE_TYPE:
        stringSpecifies what type of signature this repository uses. Can be one of
          NONE,PUBKEY orFINGERPRINTS. (default: NONE)PUBKEY:
        stringThis should be set to a path containing public key for this repository
          only. (default: NONE)FINGERPRINTS:
        stringThis should be set to a path containing known signatures for the
          repository.IP_VERSION:
        integerRestrict network access to specified IP version. 4 will only allow
          IPv4 and 6 will only allow IPv6. Any other value will use the system
          default. This option overrides the global setting with the same name
          and can be overwritten by a command line option. Default: 0.PRIORITY:
        integerSet the priority of the repository. Higher values are preferred.
          Default: 0. For a MIRROR_TYPEofNONE, any of the following URL schemes:http://,https://,file://,ssh://,tcp://. Where
    MIRROR_TYPE
    isSRV, you should use apkg+http://orpkg+https://(etc.) URL scheme. Using anhttp://URL implies that
    the hostname part is a simple hostname according to RFC 2616, and is no
    longer accepted. When SIGNATURE_TYPE is
    NONE, then no signature checking will be done on the
    repository. When SIGNATURE_TYPE isPUBKEY, then the
    PUBKEY option will
    be used for signature verification. This option is for use with the built-in
    signing support. When SIGNATURE_TYPE isFINGERPRINTS, then the
    FINGERPRINTS option will be used for signature
    verification. This option is for use with an external signing command. See
    pkg-repo(8)
    for more discussion on signature types. If FINGERPRINTS is set to
    /usr/local/etc/pkg/fingerprints/myrepo, then the
    directories
    /usr/local/etc/pkg/fingerprints/myrepo/trusted and
    /usr/local/etc/pkg/fingerprints/myrepo/revoked
    should exist with known good and bad fingerprints, respectively. Files in
    those directories should be in the format: 
function: sha256
fingerprint: sha256_representation_of_the_public_key The repository tag myrepo is an arbitrary
    string. Reusing the repository tag will cause those items defined in
    configuration files later on the REPOS_DIR search path to
    overwrite the equivalent settings for the same tag earlier on the search
    path. Hence the very common idiom, used to turn off the default
    FreeBSDconfiguration shipped in
    /etc/pkg/FreeBSD.conf. Rather than editing that file
    directly, create
    /usr/local/etc/pkg/repos/FreeBSD.conf with this
    content: Repositories are processed in the order
    they are found on the REPOS_DIR search path, with
    individual repository configuration files in the same directory processed in
    alphabetical order. Settings from files later in the search path will
    override those from earlier ones. Packages are selected preferentially out
    of all the repositories that contain them from the repository with the
    highest priority, so long as they are suitable to solve the necessary
    dependency requirements. However, this preference may be overruled when
    CONSERVATIVE_UPGRADE
    is set to true, in which case a package will as far
    as possible always be upgraded from the same repository the older installed
    version came from, as given in the
    repository
    annotation of the installed package. See
    pkg-repository(5)
    for details. It is possible to specify more than one repository per file. The following variables will be expanded during the parsing of
    pkg.conf. 
  ABIExpands to the ABI string (e.g.
      ‘FreeBSD:14:amd64’).OSNAMEExpands to the the name of the target operating system.RELEASEExpands to the full version of the target operating system.VERSION_MAJORExpands to the major version of the target operating system.VERSION_MINORExpands to the minor version of the target operating system.OSVERSIONIf targeting FreeBSD, expands to the target
      version in the same format as __FreeBSD_versioninARCHExpands to the architecture of the system. Since the values of these variables are affected by some options
    that may be set in pkg.conf(for example ABI or
    ABI_FILE), it is necessary to parse pkg.conf in two passes. The first pass
    only parses the ABI, ABI_FILE, and OSVERSION options and does no variable
    expansion. The second pass expands the variables listed above and ignores
    the ABI, ABI_FILE, and OSVERSION options. An environment variable with the same name as the option in the
    configuration file always overrides the value of an option set in the
  file. FreeBSD latest repository
  configuration: 
FreeBSD: {
    url: "pkg+https://pkg.freebsd.org/${ABI}/latest",
    enabled: true,
    signature_type: "fingerprints",
    fingerprints: "/usr/share/keys/pkg",
    mirror_type: "srv"
} FreeBSD quarterly kernel modules
    repository configuration: 
FreeBSD-kmods: {
    url: "pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
    enabled: true,
    signature_type: "fingerprints",
    fingerprints: "/usr/share/keys/pkg",
    mirror_type: "srv"
} Example for pkg.conf: 
pkg_dbdir: "/var/db/pkg"
pkg_cachedir: "/var/cache/pkg"
portsdir: "/usr/ports"
handle_rc_scripts: false
assume_always_yes: false
repos_dir: [
     "/etc/pkg",
     "/usr/local/etc/pkg/repos",
]
syslog: true
developer_mode: false
pkg_env: {
    http_proxy: "http://myproxy:3128",
}
alias: {
    origin: "info -qo",
    nonauto: "query -e '%a == 0' '%n-%v'"
} To bootstrap
    pkg(8)
    using a private repository (Assuming a
    pkg(7) new
    enough to support the bootstrapcommand.): 
# cat > /usr/local/etc/pkg/repos/example.conf <<EOF
example: {
    url: http://pkgrepo.example.com/${ABI}
}
EOF
# cat > /usr/local/etc/pkg/repos/FreeBSD.conf <<EOF
FreeBSD: {
    enabled: NO
}
EOF
# env PACKAGESITE='http://pkgrepo.example.com/${ABI}'     /usr/sbin/pkg bootstrap Note that
    pkg(7)
    uses PACKAGESITEfor the URL to download
    pkg(8)
    from, and subsequently passes it in the environment to
    pkg-static(8),
    which ignores it (possibly with a deprecation warning that should be
    ignored), and reads the configuration files instead. pkg_create(3),
    pkg_printf(3),
    pkg_repo_create(3),
    pkg_repos(3),
    pkg-keywords(5),
    pkg-lua-script(5),
    pkg-repository(5),
    pkg-script(5),
    pkg-triggers(5),
    pkg(8),
    pkg-add(8),
    pkg-alias(8),
    pkg-annotate(8),
    pkg-audit(8),
    pkg-autoremove(8),
    pkg-check(8),
    pkg-clean(8),
    pkg-config(8),
    pkg-create(8),
    pkg-delete(8),
    pkg-fetch(8),
    pkg-info(8),
    pkg-install(8),
    pkg-key(8),
    pkg-lock(8),
    pkg-query(8),
    pkg-register(8),
    pkg-repo(8),
    pkg-repositories(8),
    pkg-rquery(8),
    pkg-search(8),
    pkg-set(8),
    pkg-shell(8),
    pkg-shlib(8),
    pkg-ssh(8),
    pkg-stats(8),
    pkg-triggers(8),
    pkg-update(8),
    pkg-updating(8),
    pkg-upgrade(8),
    pkg-version(8),
    pkg-which(8) 
  Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
 |