← 返回命令列表

Linux command

dnf-system-upgrade 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Download

sudo dnf system-upgrade download --releasever=[40]

Reboot

sudo dnf system-upgrade reboot

Allow erasing

sudo dnf system-upgrade download --releasever=[40] --allowerasing

Cancel

sudo dnf system-upgrade clean

Check the status

dnf system-upgrade status

View logs

sudo dnf system-upgrade log --number=[-1]

说明

dnf system-upgrade is a DNF plugin used to perform major version upgrades of Fedora and other RPM-based distributions in an offline manner. Instead of upgrading the system while it runs, the plugin downloads every required package and then reboots into a dedicated systemd target where the transaction is applied with no user processes active. The workflow is three stages: download stages packages and verifies dependencies; reboot restarts the machine into the offline upgrade environment; on completion the system reboots again into the new release. clean discards the staged transaction if the upgrade is aborted. The plugin also exposes offline-upgrade and offline-distrosync subcommands which apply the same offline mechanism to ordinary updates and distro-syncs rather than to a release change.

参数

download
Download all packages needed for the upgrade and stage them for the next boot.
reboot
Trigger a reboot into the offline upgrade environment that performs the transaction.
clean
Remove cached packages and the saved transaction state.
status
Print the state of the current pending upgrade (no upgrade, download complete, etc).
log
List previous upgrade attempts; with --number _N_ show journal output for that boot (commonly -1 for the last).
--releasever=_VER_
Set the Fedora release version to upgrade to (e.g. 40, 41).
--allowerasing
Permit DNF to remove packages whose dependencies cannot be satisfied on the new release.
--best
Try to use the best available package versions, failing if not possible.
--nogpgcheck
Skip GPG signature verification (not recommended).

FAQ

What is the dnf-system-upgrade command used for?

dnf system-upgrade is a DNF plugin used to perform major version upgrades of Fedora and other RPM-based distributions in an offline manner. Instead of upgrading the system while it runs, the plugin downloads every required package and then reboots into a dedicated systemd target where the transaction is applied with no user processes active. The workflow is three stages: download stages packages and verifies dependencies; reboot restarts the machine into the offline upgrade environment; on completion the system reboots again into the new release. clean discards the staged transaction if the upgrade is aborted. The plugin also exposes offline-upgrade and offline-distrosync subcommands which apply the same offline mechanism to ordinary updates and distro-syncs rather than to a release change.

How do I run a basic dnf-system-upgrade example?

Run `sudo dnf system-upgrade download --releasever=[40]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does download do in dnf-system-upgrade?

Download all packages needed for the upgrade and stage them for the next boot.