]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/freebsd-update/freebsd-update.8
sysctl(9): Fix a few mandoc related issues
[FreeBSD/FreeBSD.git] / usr.sbin / freebsd-update / freebsd-update.8
1 .\"-
2 .\" Copyright 2006, 2007 Colin Percival
3 .\" All rights reserved
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted providing that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
18 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
22 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
23 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 .\" POSSIBILITY OF SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd November 14, 2020
29 .Dt FREEBSD-UPDATE 8
30 .Os
31 .Sh NAME
32 .Nm freebsd-update
33 .Nd fetch and install binary updates to FreeBSD
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl b Ar basedir
37 .Op Fl d Ar workdir
38 .Op Fl f Ar conffile
39 .Op Fl F
40 .Op Fl k Ar KEY
41 .Op Fl r Ar newrelease
42 .Op Fl s Ar server
43 .Op Fl t Ar address
44 .Op Fl -not-running-from-cron
45 .Cm command ...
46 .Sh DESCRIPTION
47 The
48 .Nm
49 tool is used to fetch, install, and rollback binary
50 updates to the
51 .Fx
52 base system.
53 Note that updates are only available if they are being built for the
54 .Fx
55 release and architecture being used; in particular, the
56 .Fx
57 Security Team only builds updates for releases shipped in binary form
58 by the
59 .Fx
60 Release Engineering Team, e.g.,
61 .Fx
62 11.2-RELEASE and
63 .Fx
64 12.0-RELEASE, but not
65 .Fx
66 11.2-STABLE or
67 .Fx
68 13.0-CURRENT.
69 .Sh OPTIONS
70 The following options are supported:
71 .Bl -tag -width "-r newrelease"
72 .It Fl b Ar basedir
73 Operate on a system mounted at
74 .Ar basedir .
75 (default:
76 .Pa / ,
77 or as given in the configuration file.)
78 .It Fl d Ar workdir
79 Store working files in
80 .Ar workdir .
81 (default:
82 .Pa /var/db/freebsd-update/ ,
83 or as given in the configuration file.)
84 .It Fl f Ar conffile
85 Read configuration options from
86 .Ar conffile .
87 (default:
88 .Pa /etc/freebsd-update.conf )
89 .It Fl F
90 Force
91 .Nm Cm fetch
92 to proceed in the case of an unfinished upgrade.
93 .It Fl k Ar KEY
94 Trust an RSA key with SHA256 of
95 .Ar KEY .
96 (default: read value from configuration file.)
97 .It Fl r Ar newrelease
98 Specify the new release (e.g., 11.2-RELEASE) to which
99 .Nm
100 should upgrade (upgrade command only).
101 .It Fl s Ar server
102 Fetch files from the specified server or server pool.
103 (default: read value from configuration file.)
104 .It Fl t Ar address
105 Mail output of
106 .Cm cron
107 command, if any, to
108 .Ar address .
109 (default: root, or as given in the configuration file.)
110 .It Fl -not-running-from-cron
111 Force
112 .Nm Cm fetch
113 to proceed when there is no controlling tty.
114 This is for use by automated scripts and orchestration tools.
115 Please do not run
116 .Nm Cm fetch
117 from crontab or similar using this flag, see:
118 .Nm Cm cron
119 .It Fl -currently-running Ar release
120 Do not detect the currently-running release; instead, assume that the
121 system is running the specified
122 .Ar release .
123 This is most likely to be useful when upgrading jails.
124 .El
125 .Sh COMMANDS
126 The
127 .Cm command
128 can be any one of the following:
129 .Bl -tag -width "rollback"
130 .It Cm fetch
131 Based on the currently installed world and the configuration
132 options set, fetch all available binary updates.
133 .It Cm cron
134 Sleep a random amount of time between 1 and 3600 seconds,
135 then download updates as if the
136 .Cm fetch
137 command was used.
138 If updates are downloaded, an email will be sent
139 (to root or a different address if specified via the
140 .Fl t
141 option or in the configuration file).
142 As the name suggests, this command is designed for running
143 from
144 .Xr cron 8 ;
145 the random delay serves to minimize the probability that
146 a large number of machines will simultaneously attempt to
147 fetch updates.
148 .It Cm upgrade
149 Fetch files necessary for upgrading to a new release.
150 Before using this command, make sure that you read the
151 announcement and release notes for the new release in
152 case there are any special steps needed for upgrading.
153 Note that this command may require up to 500 MB of space in
154 .Ar workdir
155 depending on which components of the
156 .Fx
157 base system are installed.
158 .It Cm updatesready
159 Check if there are fetched updates ready to install.
160 Returns exit code 2 if there are no updates to install.
161 .It Cm install
162 Install the most recently fetched updates or upgrade.
163 Returns exit code 2 if there are no updates to install
164 and the
165 .Cm fetch
166 command wasn't passed as an earlier argument in the same
167 invocation.
168 .It Cm rollback
169 Uninstall the most recently installed updates.
170 .It Cm IDS
171 Compare the system against a "known good" index of the
172 installed release.
173 .It Cm showconfig
174 Show configuration options after parsing conffile and command
175 line options.
176 .El
177 .Sh TIPS
178 .Bl -bullet
179 .It
180 If your clock is set to local time, adding the line
181 .Pp
182 .Dl 0 3 * * * root /usr/sbin/freebsd-update cron
183 .Pp
184 to /etc/crontab will check for updates every night.
185 If your clock is set to UTC, please pick a random time
186 other than 3AM, to avoid overly imposing an uneven load
187 on the server(s) hosting the updates.
188 .It
189 In spite of its name,
190 .Nm
191 IDS should not be relied upon as an "Intrusion Detection
192 System", since if the system has been tampered with
193 it cannot be trusted to operate correctly.
194 If you intend to use this command for intrusion-detection
195 purposes, make sure you boot from a secure disk (e.g., a CD).
196 .El
197 .Sh ENVIRONMENT
198 .Bl -tag -width "PAGER"
199 .It Ev PAGER
200 The pager program used to present various reports during the execution.
201 .Po
202 Default:
203 .Dq Pa /usr/bin/less .
204 .Pc
205 .Pp
206 .Ev PAGER
207 can be set to
208 .Dq cat
209 when a non-interactive pager is desired.
210 .El
211 .Sh FILES
212 .Bl -tag -width "/etc/freebsd-update.conf"
213 .It Pa /etc/freebsd-update.conf
214 Default location of the
215 .Nm
216 configuration file.
217 .It Pa /var/db/freebsd-update/
218 Default location where
219 .Nm
220 stores temporary files and downloaded updates.
221 .El
222 .Sh SEE ALSO
223 .Xr freebsd-update.conf 5
224 .Sh AUTHORS
225 .An Colin Percival Aq Mt cperciva@FreeBSD.org