南宁网站建设智能优化微信管理软件
文章目录
- 17.1 检查更新
- 17.2 升级
- 17.3 更新所有的包和它们的依赖
DNF是一款Linux软件包管理工具,用于管理RPM软件包。DNF可以查询软件包信息,从指定软件库获取软件包,自动处理依赖关系以安装或卸载软件包,以及更新系统到最新可用版本。
说明:
- DNF与YUM完全兼容,提供了YUM兼容的命令行以及为扩展和插件提供的API。
- 使用DNF需要管理员权限,本章所有命令需要在管理员权限下执行。
dnf可以检查您的系统中是否有软件包需要更新。您可以通过dnf列出需要更新的软件包,并可以选择一次性全部更新或者只对指定包进行更新。
17.1 检查更新
如果您需要显示当前系统可用的更新,使用命令如下:
# dnf check-update
使用实例如下:
[root@superman-21 ~]# dnf check-update
Last metadata expiration check: 2:09:07 ago on 2022年12月08日 星期四 20时26分18秒.NetworkManager.x86_64 1:1.32.12-12.oe2203 update
NetworkManager-config-server.noarch 1:1.32.12-12.oe2203 update
NetworkManager-libnm.x86_64 1:1.32.12-12.oe2203 update
acl.x86_64 2.3.1-2.oe2203 update
atk.x86_64 2.36.0-2.oe2203 update
atk-devel.x86_64 2.36.0-2.oe2203 update
augeas.x86_64 1.13.0-3.oe2203 update
authselect.x86_64 1.2.4-6.oe2203 update
bash.x86_64 5.1.8-6.oe2203 update
bc.x86_64 1.07.1-11.oe2203 update
bind-libs.x86_64 32:9.16.23-11.oe2203 update
bind-license.noarch 32:9.16.23-11.oe2203 update
bind-utils.x86_64 32:9.16.23-11.oe2203 update
.
.
.grub2-tools.x86_64 1:2.06-3.oe2203 @anaconda
grub2-tools-minimal.x86_64 1:2.06-10.oe2203 update grub2-tools.x86_64 1:2.06-3.oe2203 @anaconda
grub2-tools-minimal.x86_64 1:2.06-12.oe2203 update grub2-tools.x86_64 1:2.06-3.oe2203 @anaconda
grub2-tools-minimal.x86_64 1:2.06-13.oe2203 update grub2-tools.x86_64 1:2.06-3.oe2203 @anaconda
grub2-tools-minimal.x86_64 1:2.06-15.oe2203 update grub2-tools.x86_64 1:2.06-3.oe2203 @anaconda
[root@superman-21 ~]#
17.2 升级
- 如果您需要升级单个软件包,在root权限下执行如下命令:
# dnf update package_name
例如升级rpm包,示例如下:
[root@superman-21 ~]# dnf update dnf-data-4.10.0-3.oe2203.noarch
Last metadata expiration check: 3:01:47 ago on 2022年12月08日 星期四 20时26分18秒.
Dependencies resolved.
Nothing to do.
Complete!
[root@superman-21 ~]#
- 类似的,如果您需要升级软件包组,在root权限下执行如下命令:
# dnf group update group_name
例如示例命令如下:
[root@superman-21 ~]# dnf group update development
Last metadata expiration check: 2:59:30 ago on 2022年12月08日 星期四 20时26分18秒.
No match for group package "mod_dav_svn"
Dependencies resolved.
=============================================================================================================================Package Architecture Version Repository Size
=============================================================================================================================
Upgrading Groups:Development Tools Transaction Summary
=============================================================================================================================Is this ok [y/N]: y
Complete!
[root@superman-21 ~]#
17.3 更新所有的包和它们的依赖
要更新所有的包和它们的依赖,在root权限下执行如下命令:
# dnf update
例如示例命令如下:
[root@superman-21 ~]# dnf update
Last metadata expiration check: 3:02:21 ago on 2022年12月08日 星期四 20时26分18秒.
Dependencies resolved.
=============================================================================================================================Package Architecture Version Repository Size
=============================================================================================================================
Upgrading:NetworkManager x86_64 1:1.32.12-12.oe2203 update 2.2 MNetworkManager-config-server noarch 1:1.32.12-12.oe2203 update 12 kNetworkManager-libnm x86_64 1:1.32.12-12.oe2203 update 1.6 Macl x86_64 2.3.1-2.oe2203 update 51 katk x86_64 2.36.0-2.oe2203 update 262 katk-devel x86_64 2.36.0-2.oe2203 update 196 kaugeas x86_64 1.13.0-3.oe2203 update 376 kauthselect x86_64 1.2.4-6.oe2203 update 189 kbash x86_64 5.1.8-6.oe2203 update 1.2 Mbc x86_64 1.07.1-11.oe2203 update 89 kbind-libs x86_64 32:9.16.23-11.oe2203 update 1.2 Mbind-license noarch 32:9.16.23-11.oe2203 update 18 k
.
.
.zlib x86_64 1.2.11-22.oe2203 update 88 kzlib-devel x86_64 1.2.11-22.oe2203 update 90 k
Installing group/module packages:kernel x86_64 5.10.0-60.68.0.93.oe2203 update 55 M
Installing dependencies:duktape x86_64 2.6.0-1.oe2203 update 143 kgrub2-tools-efi x86_64 1:2.06-15.oe2203 update 463 kTransaction Summary
=============================================================================================================================
Install 3 Packages
Upgrade 243 PackagesTotal download size: 214 M
Is this ok [y/N]: y
.
.
.zlib-1.2.11-22.oe2203.x86_64 zlib-devel-1.2.11-22.oe2203.x86_64
Installed:duktape-2.6.0-1.oe2203.x86_64 grub2-tools-efi-1:2.06-15.oe2203.x86_64 kernel-5.10.0-60.68.0.93.oe2203.x86_64 Complete!
[root@superman-21 ~]#