使用dnf安装新版本软件包提示”Package xxx is already installed.”

在红帽企业Linux(RHEL)8.2版本使用过程中,使用dnf安装新版本软件包,会出现报错:“Package xxx is already installed.”

解决方案

如果在使用dnf install 更新软件包时候,请将best=True添加到/etc/dnf/dnf.conf文件中。

[root@shizhanxia.com ~]# cat /etc/dnf/dnf.conf [main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True best=True <------- skip_if_unavailable=False

诊断步骤

显示dnf软件包的版本

[root@shizhanxia.com ~]# dnf repoquery --installed dnf 显示bash包已安装版本及dnf源中的版本
[root@shizhanxia.com ~]# dnf list bash

当 /etc/dnf/dnf.conf配置文件设置best=False的时候

[root@shizhanxia.com ~]# cat /etc/dnf/dnf.conf [main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True best=False skip_if_unavailable=False
[root@shizhanxia.com ~]# dnf install bash Updating Subscription Management repositories. Last metadata expiration check: 1:24:58 ago on Fri 02 Oct 2020 02:03:55 PM IST. Package bash-4.4.19-8.el8_0.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete!

当 /etc/dnf/dnf.conf配置文件设置best=True的时候

[root@shizhanxia.com ~]# cat /etc/dnf/dnf.conf [main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True best=True skip_if_unavailable=False
# dnf install bash Updating Subscription Management repositories. Last metadata expiration check: 1:25:39 ago on Fri 02 Oct 2020 02:03:55 PM IST. Package bash-4.4.19-8.el8_0.x86_64 is already installed. Dependencies resolved. Package Architecture Version Repository Size Upgrading: bash x86_64 4.4.19-10.el8 rhel-8-for-x86_64-baseos-rpms 1.6 M

原创文章,作者:保哥,如若转载,请注明出处:https://www.shizhanxia.com/1363.html

(0)
上一篇 2023年4月19日 10:49
下一篇 2023年4月19日 10:56

相关推荐

发表回复

登录后才能评论