← 返回命令列表

Linux command

needrestart 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List

needrestart

Interactively restart

sudo needrestart

Example

needrestart -v

Example

needrestart -q

Example

needrestart -k

Example

needrestart -w

Example

needrestart -b

Example

needrestart -c [path/to/config]

说明

needrestart checks which daemons need to be restarted after library upgrades. When shared libraries are updated, running processes may still use old versions in memory, potentially leaving security vulnerabilities unpatched. The tool scans running processes for deleted library files (indicating updates) and identifies services that should be restarted. It can also check for outdated kernels and CPU microcode requiring a reboot.

参数

-v
Verbose mode; show more details
-q
Quiet mode; suppress output
-k
Check if running kernel is outdated
-w
Check if CPU microcode is outdated
-b
Batch mode; non-interactive, suitable for scripts
-l
List only; do not prompt for restart
-r _mode_
Restart mode: i (interactive), a (automatic), l (list only)
-c _config_
Use specified configuration file
-p
Enable nagios plugin mode output
-f _frontend_
Select frontend: debconf, stdio, readline

FAQ

What is the needrestart command used for?

needrestart checks which daemons need to be restarted after library upgrades. When shared libraries are updated, running processes may still use old versions in memory, potentially leaving security vulnerabilities unpatched. The tool scans running processes for deleted library files (indicating updates) and identifies services that should be restarted. It can also check for outdated kernels and CPU microcode requiring a reboot.

How do I run a basic needrestart example?

Run `needrestart` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v do in needrestart?

Verbose mode; show more details