forked from freebsd/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-repository.5
307 lines (307 loc) · 8.29 KB
/
pkg-repository.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
.\"
.\" 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-repository.5
.\" $FreeBSD$
.\"
.Dd February 1, 2015
.Dt PKG-REPOSITORY 5
.Os
.Sh NAME
.Nm "package repository"
.Nd format and operation of package repositories used by
.Xr pkg 8 .
.Sh DESCRIPTION
.Nm "Package repositories"
used by the
.Xr pkg 8
program consist of one or more collections of
.Dq package tarballs
together with package catalogues and optionally various other
collected package metadata.
.Pp
Each collection consists of packages suitable for installation on a
specific system
.Sy ABI :
a combination of operating system, CPU architecture, OS version, word
size, and for certain processors endianness or similar attributes.
.Pp
The package collections are typically made available to users for
download via a web or FTP server although various other means of access
may be employed.
Encoding the
.Sy ABI
value into the repository URL allows
.Nm pkg
to automatically select the correct package collection by expanding the
special token
.Cm ${ABI}
in
.Pa pkg.conf .
.Pp
Repositories may be mirrored over several sites:
.Nm pkg
has built-in support for discovering available mirrors dynamically
given a common URL by several mechanisms.
.Sh FILESYSTEM ORGANIZATION
Only very minimal constraints on repository layout are prescribed by
.Nm pkg .
The following constraints are all that must be met:
.Bl -bullet
.It
A repository may contain several package collections with parallel
.Cm REPOSITORY_ROOTs
in order to support diverse system
.Cm ABIs .
.It
All of the content for one
.Sy ABI
should be accessible in a filesystem or URL hierarchy beneath the
.Cm REPOSITORY_ROOT .
.It
All packages available beneath one
.Cm REPOSITORY_ROOT
should be binary compatible with a specific system
.Cm ABI .
.It
The repository catalogue is located at the apex of the
repository, at a specific location relative to the
.Cm REPOSITORY_ROOT .
.El
.Pp
Package catalogues contain the paths relative to the
.Cm REPOSITORY_ROOT
for each package, allowing the full URL for downloading the
package to be constructed.
.Pp
Where a package may be applicable to more than one
.Sy ABI
(e.g., it contains only text files) symbolic or hard links, URL mappings
or other techniques may be utilised to avoid duplication of storage.
.Pp
Although no specific filesystem organization is required, the usual
convention (inherited from
.Xr pkg-install 8 )
is to create a filesystem hierarchy thus:
.Bl -tag -width "REPOSITORY"
.It Pa $REPOSITORY_ROOT/All
One directory that contains every package available from the
repository for that
.Sy ABI .
Packages are stored as package tarballs identified by name and
version.
This directory may contain several different versions of each package
accumulated over time, but the repository catalogue will only record
the latest version for each distinct package name.
.It Pa $REPOSITORY_ROOT/Latest/
May contains symbolic links to the latest versions of packages in the
.Pa All
directory.
Symbolic links contain a
.Sq latest link
style name only, without version.
As the whole
.Sq latest link
concept is rendered obsolete by
.Nm pkg ,
this will usually contain only the
.Pa pkg.txz
link, used for bootstrapping
.Nm pkg
itself on a new system.
.It Pa $REPOSITORY_ROOT/packagesite.txz
Contains one
.Cm JSON
document, which is the concatenation of the
.Pa +MANIFEST
files from each of the packages in the repository.
This is used by
.Nm pkg-1.1
or later.
.It Pa $REPOSITORY_ROOT/repo.txz
(Deprecated).
Contains the package manifest data as above, but pre-loaded into
an SQLite database.
This is supplied for backwards compatibility with
.Nm pkg-1.0 .
.It Pa $REPOSITORY_ROOT/filesite.txz
(Optional).
Contains a YAML document listing all of the files contained in all
of the packages within the repository.
.Pp
The repository may optionally contain sub-directories corresponding to
the package origins within the
.Os
ports tree.
.El
.Pp
Each of the packages listed in the repository catalogue must have a
unique
.Cm name .
There are no other constraints: package sets are not required to be
either complete (i.e., with all dependencies satisfied) or
self-consistent within a single repository.
.Sh REPOSITORY ACCESS METHODS
.Nm pkg
uses standard network protocols for repository access.
Any URL scheme understood by the
.Xr fetch 3
library may be used
.Cm ( HTTP ,
.Cm HTTPS ,
.Cm FTP
or
.Cm FILE )
as well as remote access over
.Cm SSH .
See
.Xr fetch 3
for a description of additional environment variables, including
.Ev FETCH_BIND_ADDRESS ,
.Ev FTP_LOGIN ,
.Ev FTP_PASSIVE_MODE ,
.Ev FTP_PASSWORD ,
.Ev FTP_PROXY ,
.Ev ftp_proxy ,
.Ev HTTP_AUTH ,
.Ev HTTP_PROXY ,
.Ev http_proxy ,
.Ev HTTP_PROXY_AUTH ,
.Ev HTTP_REFERER ,
.Ev HTTP_USER_AGENT ,
.Ev NETRC ,
.Ev NO_PROXY No and
.Ev no_proxy .
.Sh REPOSITORY MIRRORING
Multiple copies of a repository can be provided for resilience or
to scale up site capacity.
Two schemes are provided to auto-discover sets of mirrors given a
single repository URL.
.Bl -tag -width "HTTP"
.It Cm HTTP
The repository URL should download a text document containing a sequence
of lines beginning with
.Sq URL:
followed by any amount of white space and one URL for a repository
mirror.
Any lines not matching this pattern are ignored.
Mirrors are tried in the order listed until a download succeeds.
.It Cm SRV
For an SRV mirrored repository where the URL is specified as
.Pa http://pkgrepo.example.org/
.Cm SRV
records should be set up in the DNS:
.Bd -literal -offset indent
$ORIGIN example.com
_http._tcp.pkgrepo IN SRV 10 1 80 mirror0
IN SRV 20 1 80 mirror1
.Ed
.Pp
where the
.Cm SRV
priority and weight parameters are used to control search order and
traffic weighting between sites, and the port number and hostname are
used to construct the individual mirror URLs.
.El
.Pp
Mirrored repositories are assumed to have identical content, and only
one copy of the repository catalogue will be downloaded to apply to
all mirror sites.
.Sh WORKING WITH MULTIPLE REPOSITORIES
Where several different repositories are configured
.Nm pkg
will search amongst them all in the order specified by the
.Cm PRIORITY
settings in the
.Pa repo.conf
files, unless directed to use a single repository by the
.Fl r
flag to
.Xr pkg-fetch 8 ,
.Xr pkg-install 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-search 8
or
.Xr pkg-rquery 8 .
.Pp
Where several different versions of the same package are available,
.Nm pkg
will select the one with the highest version to install or to upgrade
an installed package to, even if a lower numbered version can be found
in a repository earlier in the list.
This applies even if an explicit version is stated on the command line.
Thus if packages
.Pa example-1.0.0
and
.Pa example-1.0.1
are available in configured repositories, then
.Bd -literal -offset indent
pkg install example-1.0.0
.Ed
.Pp
will actually result in
.Pa example-1.0.1
being installed.
To override this behaviour, on first installation of the package
select the repository with the appropriate version:
.Bd -literal -offset indent
pkg install -r repo-a example-1.0.0
.Ed
.Pp
and then to make updates to that package
.Dq sticky
to the same repository, set the value
.Cm CONSERVATIVE_UPGRADE
to
.Sy true
in
.Pa pkg.conf .
.Pp
.Sh SEE ALSO
.Xr pkg_printf 3 ,
.Xr pkg_repos 3 ,
.Xr pkg-lua-script 5 ,
.Xr pkg-script 5 ,
.Xr pkg.conf 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