forked from freebsd/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkg.conf.5
681 lines (681 loc) · 17.6 KB
/
pkg.conf.5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\"
.\" @(#)pkg.1
.\" $FreeBSD$
.\"
.Dd March 13, 2021
.Dt PKG.CONF 5
.Os
.Sh NAME
.Nm "pkg.conf"
.Nd system-wide configuration file for
.Xr pkg 8
.Sh DESCRIPTION
.Nm
is the system-wide configuration file used by the
.Xr pkg 8
tools.
.Pp
The default location of this file is
.Pa /usr/local/etc/pkg.conf .
.Pp
Lines in the file beginning with a "#" are comments
and are ignored.
.Pp
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.
.Pp
The following types of options are recognized -
boolean, string and list options.
.Pp
A boolean option is marked as enabled if one of the following values is
specified in the configuration file -
.Dv YES, TRUE
and
.Dv ON.
.Sh OPTIONS
The following options can be defined in
.Nm :
.Bl -tag -width ".Cm ABI: string"
.It Cm ABI: string
The ABI of the package you want to install.
Default: derived from the ABI of the
.Pa /usr/bin/uname
binary, if not found then
.Pa /bin/sh
binary.
.It Cm ALIAS: key/value list
Define local aliases for various
.Xr pkg 8
standard command lines.
Whenever the
.Em key
text occurs as a separate
.Sq action
word in a command line of the form
.Nm pkg Em key ... ,
substitute the
.Em value
text verbatim.
The replacement can consist of any sequence of text, which should form
a syntactically correct
.Xr pkg 8
command line when substituted in and followed by any remaining tokens from
the original command line.
Default: not set.
.It Cm ARCHIVE_SYMLINK: boolean
When creating a package, create a symlink to it using the legacy extension,
this is a backward compatibility option, default: true
.It Cm AUTOCLEAN: boolean
Automatically cleanout the content of
.Em PKG_CACHEDIR
after each non dry-run call to
.Xr pkg-install 8
or
.Xr pkg-upgrade 8 .
.It Cm DEFAULT_ALWAYS_YES: boolean
When this option is enabled
.Xr pkg 1
will default to "yes" for all questions
which require user confirmation before doing anything.
Default: NO.
.It Cm ASSUME_ALWAYS_YES: boolean
When this option is enabled
.Xr pkg 1
will automatically assume "yes" to all questions
which require user confirmation before doing anything, as if it
the
.Fl y
flag was specified.
Default: NO.
.It Cm BACKUP_LIBRARIES: boolean
If set to
.Sy true
.Xr 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
.Cm BACKUP_LIBRARY_PATH .
If it does not exist yet a new package
.Qq compat-libraries
will be created. the version will be bumped each time a new library is backed up
Default: NO.
.It Cm BACKUP_LIBRARY_PATH: string
Location where the libraries are backed up.
Default:
.Pa /usr/local/lib/compat/pkg .
.It Cm COMPRESSION_LEVEL: integer
Set the default compression level, special values are:
.Bl -tag
.It 0 default value per libarchive developers
.It -1 default value per pkg developers (default)
.El
.It Cm CONSERVATIVE_UPGRADE: boolean
Ensure 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.
.It Cm CUDF_SOLVER: string
Experimental: tells pkg to use an external CUDF solver.
Default: not set.
.It Cm CASE_SENSITIVE_MATCH: boolean
Match package names or regular expressions given on the command line
against values in the database in a case sensitive way.
Default: NO.
.It Cm DEBUG_LEVEL: integer
Incremental values from 1 to 4 produce successively more verbose
debugging output.
A setting of 0 disables debugging output.
Overridden by the
.Fl d
command line option.
Default: 0.
.It Cm DEBUG_SCRIPTS: boolean
Activate debug mode for scripts (aka set -x)
Default: NO.
.It Cm DEVELOPER_MODE: boolean
Makes certain errors immediately fatal.
Adds various warnings and
suggestions to the output of
.Xr pkg 1
as an aid to port maintainers, including indicating when the port
might be marked as architecture independent.
Default: NO.
.It Cm DOT_FILE: string
When defined to a valid path, pkg will generate a
.Xr dot 1
file with the dependency graph of the concerned transaction.
.It Cm EVENT_PIPE: string
Send all event messages to the specified FIFO or Unix socket.
Events messages should be formatted as JSON.
Default: not set.
.It Cm FETCH_RETRY: integer
Number of times to retry a failed fetch of a file.
Default: 3.
.It Cm FETCH_TIMEOUT: integer
Maximum number of seconds to wait for any one file to download from the
network, either by SSH or any of the protocols supported by
.Xr fetch 3
functions.
Default: 30.
.It Cm HANDLE_RC_SCRIPTS: boolean
When 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
.Pa /etc/rc.conf .
Default: NO.
.It Cm HTTP_USER_AGENT: string
Define User-agent to be sent to HTTP server when getting repository
data.
.It Cm IGNORE_OSVERSION: boolean [FreeBSD specific]
Ignore FreeBSD OS version check, useful on -STABLE and -CURRENT branches.
Default: NO.
.It Cm INDEXDIR: string
If set, the directory to search for
.Cm INDEXFILE
in.
If unset,
.Cm PORTSDIR
will be searched instead.
Default: not set.
.It Cm INDEXFILE: string
The filename of the ports index, searched for in
.Cm INDEXDIR
or
.Cm PORTSDIR .
Default: INDEX-N where
.Cm N
is the OS major version number.
.It Cm IP_VERSION: integer
Restrict 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.
.It Cm LOCK_RETRIES: integer
Number of attempts to obtain a lock before giving up and exiting.
Default: 5.
.It Cm LOCK_WAIT: integer
Wait time in seconds to regain a lock if it is not available.
Default: 1.
.It Cm METALOG: string
If set,
.Xr pkg 8
will write a METALOG of the extracted files.
.It Cm NAMESERVER: string
Hostname or IPv4 or IPv6 address of name server to use for DNS
resolution, overriding the system defaults in
.Pa /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
.Xr getaddrinfo 3 .
.It Cm PERMISSIVE: boolean
Ignore conflicts while registering a package.
Note that the conflicting files will not be recorded as owned by the new
package.
Default: NO.
.It Cm PKG_CACHEDIR: string
Specifies the cache directory for packages.
Default:
.Pa /var/cache/pkg .
.It Cm PKG_CREATE_VERBOSE: boolean
When set to a
.Sy true
value, make
.Xr pkg-create 8
use verbose mode as standard.
Default:
.Sy NO .
.It Cm PKG_DBDIR: string
Specifies the directory to use for storing the package
database files.
Default:
.Pa /var/db/pkg .
.It Cm PKG_ENABLE_PLUGINS: boolean
When set to
.Dq YES ,
activate plugin support.
Default: YES.
.It Cm PKG_ENV: Key/Value list
This tells
.Xr pkg 8
to set key/values to be passed in the environment.
This allows control over underlying libraries like
.Xr fetch 3 ,
which can be configured by e.g., setting
.Ev FTP_PROXY
and
.Ev HTTP_PROXY .
Default: not set.
.It Cm PKG_PLUGINS_DIR: string
Directory which
.Xr pkg 8
will load plugins from.
Default:
.Pa /usr/local/lib/pkg .
.It Cm PKG_TRIGGERS_ENABLE
Enable or disable execution of triggers at the end of the transactions.
Default: YES.
.It Cm PKG_TRIGGERS_DIR
Directory where the triggers are stored
Default:
.Pa /usr/local/share/pkg/triggers .
.It Cm PKG_SSH_ARGS: string
Extra arguments to pass to
.Xr ssh 1 .
Default: not set.
.It Cm PLIST_KEYWORDS_DIR: string
Directory containing definitions of plist keywords.
Default: PORTSDIR/keyword.
.It Cm PLIST_ACCEPT_DIRECTORIES: boolean
Accept directories listed like plain files in plist.
Default: NO.
.It Cm PLUGINS: array
List of plugins that
.Xr pkg 8
should load.
Default: not set.
.It Cm PLUGINS_CONF_DIR: string
Directory containing per-plugin configuration files.
Default:
.Pa /usr/local/etc/pkg .
.It Cm PORTSDIR: string
Specifies the location to the Ports directory.
Default:
.Pa /usr/ports .
.It Cm READ_LOCK: boolean
Use read locking for query database.
Default: NO.
.It Cm REPOS_DIR: array
List of directories to search for repository configuration files.
Default:
.Pa /etc/pkg/ ,
.Pa /usr/local/etc/pkg/repos/ .
.It Cm REPO_AUTOUPDATE: boolean
When true, automatically check for and download updates to
.Pa /var/db/pkg/repo.sqlite
when running one of:
.Nm pkg fetch ,
.Nm pkg install ,
.Nm pkg rquery ,
.Nm pkg search ,
.Nm pkg upgrade ,
or
.Nm pkg version -R .
Default: YES.
.It Cm RUN_SCRIPTS: boolean
Run pre-/post-installation action scripts.
Default: YES.
.It Cm SAT_SOLVER: string
Experimental: tells pkg to use an external SAT solver.
Default: not set.
.It Cm SQLITE_PROFILE: boolean
Profile SQLite queries.
Default: NO.
.It Cm SSH_RESTRICT_DIR: string
Directory which the ssh subsystem will be restricted to.
Default: not set.
.It Cm SYSLOG: boolean
Log all of the installation/deinstallation/upgrade operations via
.Xr syslog 3 .
Default: YES.
.It Cm UNSET_TIMESTAMP: boolean
Do not include timestamps in the package
.Xr tar 1
archive.
Normally, timestamps are copied from the staging directory the
package is created from.
Default: NO.
.It Cm VERSION_SOURCE: string
Default database for comparing version numbers in
.Xr pkg-version 8 .
Valid values are
.Sy I
for index,
.Sy P
for ports,
.Sy R
for remote.
Default: If unset, the algorithm described in
.Xr pkg-version 8
is used to determine the version source automatically.
.It Cm VALID_URL_SCHEME
List of url scheme that pkg can accept while parsing the repository
confguration file.
.It Cm VULNXML_SITE: string
Specifies the URL to fetch the
.Pa vuln.xml
vulnerability database from.
Default:
.Pa http://vuxml.freebsd.org/freebsd/vuln.xml.xz .
.It Cm WARN_SIZE_LIMIT: integer
When download and total change is less than than this option, don't ask
the user to confirm the desired action.
Default:
.Sy 1048576
.Pq 1MB .
.It Cm WORKERS_COUNT: integer
How many workers are used for pkg-repo.
If set to 0,
.Va hw.ncpu
is used.
Default: 0.
.El
.Sh REPOSITORY CONFIGURATION
To use a repository you will need at least one repository
configuration file.
.Pp
Repository configuration files are searched for in order of the
directories listed in the
.Cm REPOS_DIR
array,
which defaults to
.Pa /etc/pkg/
and
.Pa /usr/local/etc/pkg/repos/ .
.Pp
Filenames are arbitrary, but should end in
.Sq .conf .
For example
.Pa /usr/local/etc/pkg/repos/myrepo.conf .
.Pp
A repository file is in UCL format and has the following form:
.Bl -tag -width ".Cm myrepo:"
.It Cm myrepo:
.Bl -tag -width ".Cm MIRROR_TYPE: string"
.It Cm ENV: object
A list of key value entries that will be passed as environment variable
for the bundled
.Xr fetch 3 ,
per repository.
.It Cm URL: string
URL for this repository only.
.It Cm ENABLED: boolean
The repository will be used only if this option is enabled.
Default: YES.
.It Cm MIRROR_TYPE: string
MIRROR_TYPE for this repository only.
Default: NONE.
Any of
.Dv HTTP
or
.Dv SRV
or
.Dv NONE .
.It Cm SIGNATURE_TYPE: string
Specifies what type of signature this repository uses.
Can be one of
.Dv NONE ,
.Dv PUBKEY or
.Dv FINGERPRINTS .
(default: NONE)
.It Cm PUBKEY: string
This should be set to a path containing public key for this repository
only. (default: NONE)
.It Cm FINGERPRINTS: string
This should be set to a path containing known signatures for the repository.
.It Cm IP_VERSION: integer
Restrict 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.
.It Cm PRIORITY: integer
Set the priority of the repository.
Higher values are preferred.
Default: 0.
.El
.El
.Pp
For a
.Cm MIRROR_TYPE
of
.Dv NONE ,
any of the URL schemes supported by
.Xr libfetch 3
can be used, including:
.Dv http:// ,
.Dv https:// ,
.Dv ftp:// ,
or
.Dv file:// .
In addition a
.Dv ssh://
URL scheme is also supported.
Where
.Sy MIRROR_TYPE
is
.Dv SRV ,
you should use a
.Dv pkg+http://
or
.Dv pkg+https://
(etc.) URL scheme.
Using an
.Dv http://
URL implies that the hostname part is a simple hostname according to
RFC 2616, and is no longer accepted.
.Pp
When
.Sy SIGNATURE_TYPE
is
.Dv NONE ,
then no signature checking will be done on the repository.
When
.Sy SIGNATURE_TYPE
is
.Dv PUBKEY ,
then the
.Sy PUBKEY
option will be used for signature verification.
This option is for use with the built-in signing support.
When
.Sy SIGNATURE_TYPE
is
.Dv FINGERPRINTS ,
then the
.Sy FINGERPRINTS
option will be used for signature verification.
This option is for use with an external signing command.
See
.Xr pkg-repo 8
for more discussion on signature types.
.Pp
If
.Sy FINGERPRINTS
is set to
.Pa /usr/local/etc/pkg/fingerprints/myrepo ,
then the directories
.Pa /usr/local/etc/pkg/fingerprints/myrepo/trusted
and
.Pa /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:
.Bd -literal -offset indent
function: sha256
fingerprint: sha256_representation_of_the_public_key
.Ed
.Pp
The repository tag
.Fa myrepo
is an arbitrary string.
Reusing the repository tag will cause those items defined in
configuration files later on the
.Sy 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
.Cm FreeBSD
configuration shipped in
.Pa /etc/pkg/FreeBSD.conf .
Rather than editing that file directly, create
.Pa /usr/local/etc/pkg/repos/FreeBSD.conf
with this content:
.Bd -literal -offset indent
FreeBSD: { enabled: NO }
.Ed
.Pp
Repositories are processed in the order they are found on the
.Sy 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
.Sy CONSERVATIVE_UPGRADE
is set to
.Dv 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
.Sy repository
annotation of the installed package.
See
.Xr pkg-repository 8
for details.
.Pp
It is possible to specify more than one repository per file.
.Sh VARIABLES
The following variables will be expanded during the parsing of
.Nm
.Bl -tag -width Ds
.It Va ABI
.It Va OSNAME
Expands to the full version of the name of the operating system.
.It Va RELEASE
Expands to the full version of the operating system.
.It Va VERSION_MAJOR
If supported, expands to the major version of the operating system.
(Only supported on
.Fx
)
.It Va VERSION_MINOR
If supported, expands to the minor version of the operating system.
(Only supported on
.Fx
)
.It Va ARCH
Expands the architecture of the system.
.El
.Sh ENVIRONMENT
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.
.Sh EXAMPLES
Repository configuration file:
.Bd -literal -offset indent
FreeBSD: {
url: "pkg+http://pkg.freebsd.org/${ABI}/latest",
enabled: true,
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
mirror_type: "srv"
}
.Ed
.Pp
Example for pkg.conf:
.Bd -literal -offset indent
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'"
}
.Ed
.Pp
To bootstrap
.Xr pkg 8
using a private repository (Assuming a
.Xr pkg 7
new enough to support the
.Cm bootstrap
command.):
.Bd -literal -offset indent
# 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
.Ed
.Pp
Note that
.Xr pkg 7
uses
.Ev PACKAGESITE
for the URL to download
.Xr pkg 8
from, and subsequently passes it in the environment to
.Xr pkg-static 8 ,
which ignores it (possibly with a deprecation warning that should be
ignored), and reads the configuration files instead.
.Sh SEE ALSO
.Xr pkg_printf 3 ,
.Xr pkg_repos 3 ,
.Xr pkg-lua-script 5 ,
.Xr pkg-repository 5 ,
.Xr pkg-script 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
.Xr pkg-alias 8 ,
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
.Xr pkg-check 8 ,
.Xr pkg-clean 8 ,
.Xr pkg-config 8 ,
.Xr pkg-create 8 ,
.Xr pkg-delete 8 ,
.Xr pkg-fetch 8 ,
.Xr pkg-info 8 ,
.Xr pkg-install 8 ,
.Xr pkg-lock 8 ,
.Xr pkg-query 8 ,
.Xr pkg-register 8 ,
.Xr pkg-repo 8 ,
.Xr pkg-rquery 8 ,
.Xr pkg-search 8 ,
.Xr pkg-set 8 ,
.Xr pkg-shell 8 ,
.Xr pkg-shlib 8 ,
.Xr pkg-ssh 8 ,
.Xr pkg-stats 8 ,
.Xr pkg-update 8 ,
.Xr pkg-updating 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-version 8 ,
.Xr pkg-which 8