检查并更新
dnf可以检查您的系统中是否有软件包需要更新。您可以通过dnf列出需要更新的软件包,并可以选择一次性全部更新或者只对指定包进行更新。
检查更新
如果您需要显示当前系统可用的更新,使用命令如下:
dnf check-update
使用实例如下:
# dnf check-update
Last metadata expiration check: 0:02:10 ago on Sun 01 Sep 2019 11:28:07 PM CST.
anaconda-core.aarch64 19.31.123-1.14 updates
anaconda-gui.aarch64 19.31.123-1.14 updates
anaconda-tui.aarch64 19.31.123-1.14 updates
anaconda-user-help.aarch64 19.31.123-1.14 updates
anaconda-widgets.aarch64 19.31.123-1.14 updates
bind-libs.aarch64 32:9.9.4-29.3 updates
bind-libs-lite.aarch64 32:9.9.4-29.3 updates
bind-license.noarch 32:9.9.4-29.3 updates
bind-utils.aarch64 32:9.9.4-29.3 updates
...
升级
如果您需要升级单个软件包,在root权限下执行如下命令:
dnf update package_name
例如升级rpm包,示例如下:
# dnf update anaconda-gui.aarch64
Last metadata expiration check: 0:02:10 ago on Sun 01 Sep 2019 11:30:27 PM CST.
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
anaconda-gui aarch64 19.31.123-1.14 updates 461 k
anaconda-core aarch64 19.31.123-1.14 updates 1.4 M
anaconda-tui aarch64 19.31.123-1.14 updates 274 k
anaconda-user-help aarch64 19.31.123-1.14 updates 315 k
anaconda-widgets aarch64 19.31.123-1.14 updates 748 k
Transaction Summary
================================================================================
Upgrade 5 Package
Total download size: 3.1 M
Is this ok [y/N]:
类似的,如果您需要升级软件包组,在root权限下执行如下命令:
dnf group update group_name
更新所有的包和它们的依赖
要更新所有的包和它们的依赖,在root权限下执行如下命令:
dnf update