xref: /freebsd/usr.sbin/freebsd-update/freebsd-update.8 (revision 075999d3f1cb013826e110c26af8528fef2c72ca)
148ffe56aSColin Percival.\"-
2db6b0a61SColin Percival.\" Copyright 2006, 2007 Colin Percival
348ffe56aSColin Percival.\" All rights reserved
448ffe56aSColin Percival.\"
548ffe56aSColin Percival.\" Redistribution and use in source and binary forms, with or without
648ffe56aSColin Percival.\" modification, are permitted providing that the following conditions
748ffe56aSColin Percival.\" are met:
848ffe56aSColin Percival.\" 1. Redistributions of source code must retain the above copyright
948ffe56aSColin Percival.\"    notice, this list of conditions and the following disclaimer.
1048ffe56aSColin Percival.\" 2. Redistributions in binary form must reproduce the above copyright
1148ffe56aSColin Percival.\"    notice, this list of conditions and the following disclaimer in the
1248ffe56aSColin Percival.\"    documentation and/or other materials provided with the distribution.
1348ffe56aSColin Percival.\"
1448ffe56aSColin Percival.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1548ffe56aSColin Percival.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1648ffe56aSColin Percival.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1748ffe56aSColin Percival.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
1848ffe56aSColin Percival.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1948ffe56aSColin Percival.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2048ffe56aSColin Percival.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2148ffe56aSColin Percival.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2248ffe56aSColin Percival.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
2348ffe56aSColin Percival.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2448ffe56aSColin Percival.\" POSSIBILITY OF SUCH DAMAGE.
2548ffe56aSColin Percival.\"
2648ffe56aSColin Percival.\" $FreeBSD$
2748ffe56aSColin Percival.\"
2815647a71SMateusz Piotrowski.Dd March 29, 2022
2948ffe56aSColin Percival.Dt FREEBSD-UPDATE 8
30c0755420SEd Maste.Os
3148ffe56aSColin Percival.Sh NAME
3248ffe56aSColin Percival.Nm freebsd-update
3348ffe56aSColin Percival.Nd fetch and install binary updates to FreeBSD
3448ffe56aSColin Percival.Sh SYNOPSIS
3548ffe56aSColin Percival.Nm
3648ffe56aSColin Percival.Op Fl b Ar basedir
3748ffe56aSColin Percival.Op Fl d Ar workdir
3848ffe56aSColin Percival.Op Fl f Ar conffile
398935f242SAllan Jude.Op Fl F
40c76da1f0SFaraz Vahedi.Op Fl j Ar jail
4148ffe56aSColin Percival.Op Fl k Ar KEY
42db6b0a61SColin Percival.Op Fl r Ar newrelease
4348ffe56aSColin Percival.Op Fl s Ar server
4448ffe56aSColin Percival.Op Fl t Ar address
458935f242SAllan Jude.Op Fl -not-running-from-cron
4615647a71SMateusz Piotrowski.Ar command ...
4748ffe56aSColin Percival.Sh DESCRIPTION
4848ffe56aSColin PercivalThe
4948ffe56aSColin Percival.Nm
5048ffe56aSColin Percivaltool is used to fetch, install, and rollback binary
51c0755420SEd Masteupdates to the
52c0755420SEd Maste.Fx
53c0755420SEd Mastebase system.
54764dd6b4SColin PercivalNote that updates are only available if they are being built for the
55c0755420SEd Maste.Fx
56c0755420SEd Masterelease and architecture being used; in particular, the
57764dd6b4SColin Percival.Fx
58764dd6b4SColin PercivalSecurity Team only builds updates for releases shipped in binary form
59764dd6b4SColin Percivalby the
60764dd6b4SColin Percival.Fx
61764dd6b4SColin PercivalRelease Engineering Team, e.g.,
62764dd6b4SColin Percival.Fx
633f877103SEd Maste11.2-RELEASE and
64764dd6b4SColin Percival.Fx
653f877103SEd Maste12.0-RELEASE, but not
66764dd6b4SColin Percival.Fx
673f877103SEd Maste11.2-STABLE or
68764dd6b4SColin Percival.Fx
693f877103SEd Maste13.0-CURRENT.
7048ffe56aSColin Percival.Sh OPTIONS
71344c81a1SWarren BlockThe following options are supported:
728935f242SAllan Jude.Bl -tag -width "-r newrelease"
7348ffe56aSColin Percival.It Fl b Ar basedir
7448ffe56aSColin PercivalOperate on a system mounted at
7548ffe56aSColin Percival.Ar basedir .
7648ffe56aSColin Percival(default:
7748ffe56aSColin Percival.Pa / ,
7848ffe56aSColin Percivalor as given in the configuration file.)
7948ffe56aSColin Percival.It Fl d Ar workdir
8048ffe56aSColin PercivalStore working files in
8148ffe56aSColin Percival.Ar workdir .
8248ffe56aSColin Percival(default:
8348ffe56aSColin Percival.Pa /var/db/freebsd-update/ ,
8448ffe56aSColin Percivalor as given in the configuration file.)
8548ffe56aSColin Percival.It Fl f Ar conffile
8648ffe56aSColin PercivalRead configuration options from
8748ffe56aSColin Percival.Ar conffile .
8848ffe56aSColin Percival(default:
8948ffe56aSColin Percival.Pa /etc/freebsd-update.conf )
908935f242SAllan Jude.It Fl F
918935f242SAllan JudeForce
928935f242SAllan Jude.Nm Cm fetch
93df7e2e0dSEd Masteto proceed in the case of an unfinished upgrade.
94c76da1f0SFaraz Vahedi.It Fl j Ar jail
95c76da1f0SFaraz VahediOperate on the given jail specified by
96c76da1f0SFaraz Vahedi.Va jid
97c76da1f0SFaraz Vahedior
98c76da1f0SFaraz Vahedi.Va name .
99c76da1f0SFaraz Vahedi(The version of the installed userland is detected and the
100c76da1f0SFaraz Vahedi.Fl -currently-running
101c76da1f0SFaraz Vahedioption is no more required.)
10248ffe56aSColin Percival.It Fl k Ar KEY
10348ffe56aSColin PercivalTrust an RSA key with SHA256 of
10448ffe56aSColin Percival.Ar KEY .
10548ffe56aSColin Percival(default: read value from configuration file.)
106db6b0a61SColin Percival.It Fl r Ar newrelease
10718a52cf4SEd MasteSpecify the new release (e.g., 11.2-RELEASE) to which
108db6b0a61SColin Percival.Nm
10915647a71SMateusz Piotrowskishould upgrade
11015647a71SMateusz Piotrowski.Pq Cm upgrade No command only .
11148ffe56aSColin Percival.It Fl s Ar server
11248ffe56aSColin PercivalFetch files from the specified server or server pool.
11348ffe56aSColin Percival(default: read value from configuration file.)
11448ffe56aSColin Percival.It Fl t Ar address
11548ffe56aSColin PercivalMail output of
11648ffe56aSColin Percival.Cm cron
11748ffe56aSColin Percivalcommand, if any, to
11848ffe56aSColin Percival.Ar address .
11948ffe56aSColin Percival(default: root, or as given in the configuration file.)
1208935f242SAllan Jude.It Fl -not-running-from-cron
1218935f242SAllan JudeForce
1228935f242SAllan Jude.Nm Cm fetch
12315647a71SMateusz Piotrowskito proceed when there is no controlling
12415647a71SMateusz Piotrowski.Xr tty 4 .
1258935f242SAllan JudeThis is for use by automated scripts and orchestration tools.
1268935f242SAllan JudePlease do not run
1278935f242SAllan Jude.Nm Cm fetch
12815647a71SMateusz Piotrowskifrom
12915647a71SMateusz Piotrowski.Xr crontab 5
13015647a71SMateusz Piotrowskior similar using this flag, see:
1318935f242SAllan Jude.Nm Cm cron
132b39ce43eSColin Percival.It Fl -currently-running Ar release
1331a20115cSGlen BarberDo not detect the currently-running release; instead, assume that the
134b39ce43eSColin Percivalsystem is running the specified
135b39ce43eSColin Percival.Ar release .
136b39ce43eSColin PercivalThis is most likely to be useful when upgrading jails.
13748ffe56aSColin Percival.El
13848ffe56aSColin Percival.Sh COMMANDS
13948ffe56aSColin PercivalThe
14048ffe56aSColin Percival.Cm command
14148ffe56aSColin Percivalcan be any one of the following:
1428935f242SAllan Jude.Bl -tag -width "rollback"
14348ffe56aSColin Percival.It Cm fetch
14448ffe56aSColin PercivalBased on the currently installed world and the configuration
14548ffe56aSColin Percivaloptions set, fetch all available binary updates.
14648ffe56aSColin Percival.It Cm cron
14748ffe56aSColin PercivalSleep a random amount of time between 1 and 3600 seconds,
14848ffe56aSColin Percivalthen download updates as if the
14948ffe56aSColin Percival.Cm fetch
15048ffe56aSColin Percivalcommand was used.
15148ffe56aSColin PercivalIf updates are downloaded, an email will be sent
15248ffe56aSColin Percival(to root or a different address if specified via the
15348ffe56aSColin Percival.Fl t
15448ffe56aSColin Percivaloption or in the configuration file).
15548ffe56aSColin PercivalAs the name suggests, this command is designed for running
15648ffe56aSColin Percivalfrom
15748ffe56aSColin Percival.Xr cron 8 ;
15848ffe56aSColin Percivalthe random delay serves to minimize the probability that
15948ffe56aSColin Percivala large number of machines will simultaneously attempt to
16048ffe56aSColin Percivalfetch updates.
161db6b0a61SColin Percival.It Cm upgrade
162db6b0a61SColin PercivalFetch files necessary for upgrading to a new release.
163db6b0a61SColin PercivalBefore using this command, make sure that you read the
164db6b0a61SColin Percivalannouncement and release notes for the new release in
165db6b0a61SColin Percivalcase there are any special steps needed for upgrading.
166adbcc996SColin PercivalNote that this command may require up to 500 MB of space in
167adbcc996SColin Percival.Ar workdir
168adbcc996SColin Percivaldepending on which components of the
169adbcc996SColin Percival.Fx
170adbcc996SColin Percivalbase system are installed.
1718cfda118SMichael Gmelin.It Cm updatesready
1728cfda118SMichael GmelinCheck if there are fetched updates ready to install.
1738cfda118SMichael GmelinReturns exit code 2 if there are no updates to install.
17448ffe56aSColin Percival.It Cm install
175db6b0a61SColin PercivalInstall the most recently fetched updates or upgrade.
1768cfda118SMichael GmelinReturns exit code 2 if there are no updates to install
1778cfda118SMichael Gmelinand the
1788cfda118SMichael Gmelin.Cm fetch
1798cfda118SMichael Gmelincommand wasn't passed as an earlier argument in the same
1808cfda118SMichael Gmelininvocation.
18148ffe56aSColin Percival.It Cm rollback
18248ffe56aSColin PercivalUninstall the most recently installed updates.
18308e23beeSColin Percival.It Cm IDS
18408e23beeSColin PercivalCompare the system against a "known good" index of the
18508e23beeSColin Percivalinstalled release.
1868cfda118SMichael Gmelin.It Cm showconfig
1878cfda118SMichael GmelinShow configuration options after parsing conffile and command
1888cfda118SMichael Gmelinline options.
18948ffe56aSColin Percival.El
19048ffe56aSColin Percival.Sh TIPS
19148ffe56aSColin Percival.Bl -bullet
19248ffe56aSColin Percival.It
19348ffe56aSColin PercivalIf your clock is set to local time, adding the line
19448ffe56aSColin Percival.Pp
19548ffe56aSColin Percival.Dl 0 3 * * * root /usr/sbin/freebsd-update cron
19648ffe56aSColin Percival.Pp
19715647a71SMateusz Piotrowskito
19815647a71SMateusz Piotrowski.Pa /etc/crontab
19915647a71SMateusz Piotrowskiwill check for updates every night.
20087b66e43SColin PercivalIf your clock is set to UTC, please pick a random time
20148ffe56aSColin Percivalother than 3AM, to avoid overly imposing an uneven load
20248ffe56aSColin Percivalon the server(s) hosting the updates.
20308e23beeSColin Percival.It
20408e23beeSColin PercivalIn spite of its name,
20563d46d1dSUlrich Spörlein.Nm
20608e23beeSColin PercivalIDS should not be relied upon as an "Intrusion Detection
207c170a96bSJohn-Mark GurneySystem", since if the system has been tampered with
20808e23beeSColin Percivalit cannot be trusted to operate correctly.
20908e23beeSColin PercivalIf you intend to use this command for intrusion-detection
21008e23beeSColin Percivalpurposes, make sure you boot from a secure disk (e.g., a CD).
21148ffe56aSColin Percival.El
21232f45927SMateusz Piotrowski.Sh ENVIRONMENT
21332f45927SMateusz Piotrowski.Bl -tag -width "PAGER"
21432f45927SMateusz Piotrowski.It Ev PAGER
21532f45927SMateusz PiotrowskiThe pager program used to present various reports during the execution.
21632f45927SMateusz Piotrowski.Po
21732f45927SMateusz PiotrowskiDefault:
21832f45927SMateusz Piotrowski.Dq Pa /usr/bin/less .
21932f45927SMateusz Piotrowski.Pc
22032f45927SMateusz Piotrowski.Pp
22132f45927SMateusz Piotrowski.Ev PAGER
22232f45927SMateusz Piotrowskican be set to
22332f45927SMateusz Piotrowski.Dq cat
22432f45927SMateusz Piotrowskiwhen a non-interactive pager is desired.
22532f45927SMateusz Piotrowski.El
22648ffe56aSColin Percival.Sh FILES
22748ffe56aSColin Percival.Bl -tag -width "/etc/freebsd-update.conf"
2282710751bSJoel Dahl.It Pa /etc/freebsd-update.conf
22948ffe56aSColin PercivalDefault location of the
23048ffe56aSColin Percival.Nm
23148ffe56aSColin Percivalconfiguration file.
2322710751bSJoel Dahl.It Pa /var/db/freebsd-update/
23348ffe56aSColin PercivalDefault location where
23448ffe56aSColin Percival.Nm
23548ffe56aSColin Percivalstores temporary files and downloaded updates.
23648ffe56aSColin Percival.El
23748ffe56aSColin Percival.Sh SEE ALSO
238*075999d3SMateusz Piotrowski.Xr freebsd-update.conf 5 ,
239*075999d3SMateusz Piotrowski.Xr nextboot 8
24048ffe56aSColin Percival.Sh AUTHORS
24101c2b8acSBaptiste Daroussin.An Colin Percival Aq Mt cperciva@FreeBSD.org
242