.\" Man page generated from reStructuredText .\" by the Docutils 0.22.4 manpage writer. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "DNF5-NEEDS-RESTARTING" "8" "Apr 23, 2026" "" "dnf5" .SH NAME dnf5-needs-restarting \- Needs-restarting Command .SH SYNOPSIS .sp \fBdnf5 needs\-restarting [\-p | \-\-processes [\-e | \-\-exclude\-services]] [\-s | \-\-services] [\-r | \-\-reboothint] [\-\-json]\fP .SH DESCRIPTION .sp The \fBneeds\-restarting\fP command determines whether the system should be rebooted to fully apply changes from package installations and upgrades. Without any options, \fBdnf5 needs\-restarting\fP will report whether any important packages were installed or upgraded since boot. This set of important packages includes the kernel, systemd, each package listed here: \%, and any package marked with a \fBreboot_suggested\fP advisory. .sp The \fBneeds\-restarting\fP command will exit with code 1 if a reboot is recommended, or, when invoked with \fB\-\-services\fP, if any systemd service needs restarting. If no action is recommended, \fBneeds\-restarting\fP will exit with code 0. .SH OPTIONS .INDENT 0.0 .TP .B \fB\-p, \-\-processes\fP .nf List processes that need restarting. If the package that provides the executable running, or any of its dependencies, have been updated since the process started, then restarting the process will be recommended. .fi .sp .TP .B \fB\-e, \-\-exclude\-services\fP .nf Used with the \fB\-p, \-\-processes\fP option and will filter out any processes that are handled by systemd services. .fi .sp .TP .B \fB\-s, \-\-services\fP .nf List systemd services that need restarting. If the package that provides the service, or any of its dependencies, have been updated since the service started, then restarting the service will be recommended. Note that this approach is quite aggressive to recommend a restart when one may not be strictly necessary. .fi .sp .TP .B \fB\-r, \-\-reboothint\fP .nf Has no effect, kept for compatibility with DNF 4. \(dqdnf4 needs\-restarting \-r\(dq provides the same functionality as \(dqdnf5 needs\-restarting\(dq. .fi .sp .TP .B \fB\-\-json\fP .nf Request JSON output format for machine\-readable results. .fi .sp .UNINDENT .SH JSON OUTPUT .INDENT 0.0 .IP \(bu 2 \fBdnf5 needs\-restarting \-\-json\fP .UNINDENT .sp The command returns a JSON array containing a single object with the reboot hint information. The object contains the following fields: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fBtype\fP (string) \- Type of output, always \(dqreboot\(dq. .IP \(bu 2 \fBreboot_required\fP (boolean) \- Whether a reboot is required. .IP \(bu 2 \fBpackages\fP (array of strings) \- List of packages that were updated since boot\-up. .IP \(bu 2 \fBdocumentation\fP (string) \- Link to documentation explaining the reboot requirement. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 \fBdnf5 needs\-restarting \-\-services \-\-json\fP .UNINDENT .sp The command returns a JSON array of objects, each describing a systemd service that needs restarting. Each object contains the following fields: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fBtype\fP (string) \- Type of output, always \(dqunit\(dq. .IP \(bu 2 \fBunit\fP (string) \- Name of the systemd service. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 \fBdnf5 needs\-restarting \-\-processes \-\-json\fP .UNINDENT .sp The command returns a JSON array of objects, each describing a running process that needs restarting. Each object contains the following fields: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fBtype\fP (string) \- Type of output, always \(dqprocess\(dq. .IP \(bu 2 \fBpid\fP (integer) \- Process ID. .IP \(bu 2 \fBcmdline\fP (array of strings) \- Command line of the process. .IP \(bu 2 \fBpackage\fP (string) \- Package providing the executable. .UNINDENT .UNINDENT .UNINDENT .sp The \fB\-\-json\fP option can be combined with \fB\-\-exclude\-services\fP when using \fB\-\-processes\fP to filter out processes managed by systemd services (e.g. \fBdnf5 needs\-restarting \-\-processes \-\-exclude\-services \-\-json\fP). .sp For empty results for services or processes, the commands return \fB[]\fP\&. For reboot hints, even if no reboot is recommended, the command returns a JSON array containing a single object with \fBreboot_required\fP set to false, an empty array of \fBpackages\fP, and the \fBdocumentation\fP link. .SH Author See AUTHORS.md in dnf5 source distribution. .SH Copyright Contributors to the dnf5 project. .\" End of generated man page.