xref: /freebsd/usr.sbin/freebsd-update/freebsd-update.8 (revision 389e4940069316fe667ffa263fa7d6390d0a960f)
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 June 14, 2017
29.Dt FREEBSD-UPDATE 8
30.Os FreeBSD
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
47The
48.Nm
49tool is used to fetch, install, and rollback binary
50updates to the FreeBSD base system.
51Note that updates are only available if they are being built for the
52FreeBSD release and architecture being used; in particular, the
53.Fx
54Security Team only builds updates for releases shipped in binary form
55by the
56.Fx
57Release Engineering Team, e.g.,
58.Fx
5910.3-RELEASE and
60.Fx
6111.0-RELEASE, but not
62.Fx
6310.3-STABLE or
64.Fx
6512-CURRENT.
66.Sh OPTIONS
67The following options are supported:
68.Bl -tag -width "-r newrelease"
69.It Fl b Ar basedir
70Operate on a system mounted at
71.Ar basedir .
72(default:
73.Pa / ,
74or as given in the configuration file.)
75.It Fl d Ar workdir
76Store working files in
77.Ar workdir .
78(default:
79.Pa /var/db/freebsd-update/ ,
80or as given in the configuration file.)
81.It Fl f Ar conffile
82Read configuration options from
83.Ar conffile .
84(default:
85.Pa /etc/freebsd-update.conf )
86.It Fl F
87Force
88.Nm Cm fetch
89to proceed where it normally would not, such as an unfinished upgrade
90.It Fl k Ar KEY
91Trust an RSA key with SHA256 of
92.Ar KEY .
93(default: read value from configuration file.)
94.It Fl r Ar newrelease
95Specify the new release to which
96.Nm
97should upgrade (upgrade command only).
98.It Fl s Ar server
99Fetch files from the specified server or server pool.
100(default: read value from configuration file.)
101.It Fl t Ar address
102Mail output of
103.Cm cron
104command, if any, to
105.Ar address .
106(default: root, or as given in the configuration file.)
107.It Fl -not-running-from-cron
108Force
109.Nm Cm fetch
110to proceed when there is no controlling tty.
111This is for use by automated scripts and orchestration tools.
112Please do not run
113.Nm Cm fetch
114from crontab or similar using this flag, see:
115.Nm Cm cron
116.It Fl -currently-running Ar release
117Do not detect the currently-running release; instead, assume that the
118system is running the specified
119.Ar release .
120This is most likely to be useful when upgrading jails.
121.El
122.Sh COMMANDS
123The
124.Cm command
125can be any one of the following:
126.Bl -tag -width "rollback"
127.It Cm fetch
128Based on the currently installed world and the configuration
129options set, fetch all available binary updates.
130.It Cm cron
131Sleep a random amount of time between 1 and 3600 seconds,
132then download updates as if the
133.Cm fetch
134command was used.
135If updates are downloaded, an email will be sent
136(to root or a different address if specified via the
137.Fl t
138option or in the configuration file).
139As the name suggests, this command is designed for running
140from
141.Xr cron 8 ;
142the random delay serves to minimize the probability that
143a large number of machines will simultaneously attempt to
144fetch updates.
145.It Cm upgrade
146Fetch files necessary for upgrading to a new release.
147Before using this command, make sure that you read the
148announcement and release notes for the new release in
149case there are any special steps needed for upgrading.
150Note that this command may require up to 500 MB of space in
151.Ar workdir
152depending on which components of the
153.Fx
154base system are installed.
155.It Cm install
156Install the most recently fetched updates or upgrade.
157.It Cm rollback
158Uninstall the most recently installed updates.
159.It Cm IDS
160Compare the system against a "known good" index of the
161installed release.
162.El
163.Sh TIPS
164.Bl -bullet
165.It
166If your clock is set to local time, adding the line
167.Pp
168.Dl 0 3 * * * root /usr/sbin/freebsd-update cron
169.Pp
170to /etc/crontab will check for updates every night.
171If your clock is set to UTC, please pick a random time
172other than 3AM, to avoid overly imposing an uneven load
173on the server(s) hosting the updates.
174.It
175In spite of its name,
176.Nm
177IDS should not be relied upon as an "Intrusion Detection
178System", since if the system has been tampered with
179it cannot be trusted to operate correctly.
180If you intend to use this command for intrusion-detection
181purposes, make sure you boot from a secure disk (e.g., a CD).
182.El
183.Sh FILES
184.Bl -tag -width "/etc/freebsd-update.conf"
185.It Pa /etc/freebsd-update.conf
186Default location of the
187.Nm
188configuration file.
189.It Pa /var/db/freebsd-update/
190Default location where
191.Nm
192stores temporary files and downloaded updates.
193.El
194.Sh SEE ALSO
195.Xr freebsd-update.conf 5
196.Sh AUTHORS
197.An Colin Percival Aq Mt cperciva@FreeBSD.org
198