为什么dnf list看不到源中可以更新的rpm包

我安装了一个22.03的机器,配置了自己的本地源,我在源中加入了更新的rpm包
在机器上执行dnf clean all; dnf makecache
然后执行dnf list

对于安装操作系统阶段安装进去的rpm包(例如kernel包),dnf list是看不到更新的,对于安装操作系统之后安装的rpm包,如果有更新,dnf list是可以看到的。

源是没有问题的,我把源配到centos机器上,用yum list是可以看到所有可更新的包的。

1 个赞

是不是有某种保护的参数,保证安装操作系统阶段安装的rpm包不被更新?

据我所知,目前没有听过有这种保护。
在我自己2203版本的测试中,dnf list kernel完全可以看到可更新的内核包。
请问你的系统具体版本信息是什么?
cat /etc/openEuler-latest
请问你的repo配置是什么?
cat /etc/yum.repos.d/xx.repo

1 个赞
[root@controller-1 /]# cat /etc/openEuler-latest 
openeulerversion=openEuler-22.03-LTS
compiletime=2022-03-30-16-23-56
gccversion=10.3.1-10.oe2203
kernelversion=5.10.0-60.18.0.50.oe2203
openjdkversion=1.8.0.312.b07-11.oe2203
[root@controller-1 /]# 
[root@controller-1 /]# cat /etc/yum.repos.d/fitbase.repo 
# .repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[fitos-extras]
name=Fitos-extras
failovermethod=priority
baseurl=http://172.43.2.251/repo/openEuler/x86_64
gpgcheck=0
[root@controller-1 /]# 

不能更新部分rpm包的原因是iso的repo源中指定了module,在安装iso阶段使用的是iso中的repo源,安装的rpm包被定义为模块化rpm包,在安装完系统之后,iso包的源不可用,dnf的fail-safe机制触发,模块化rpm不能被非模块化的源所升级。

解决办法以下几种:
一种方法是删除iso源中的模块化定义,不要将rpm定义为模块化的rpm包。
第二种方法,安装完操作系统之后,使用dnf module list命令找到modulefailsafe的模块,并将该module disable掉。
第三种方法,在本地源的.repo配置文件中加上module_hotfixes=true配置,重新makecache之后就可以更新了。

相关资料参考:
https://dnf.readthedocs.io/en/latest/modularity.html#modularity

https://forums.centos.org/viewtopic.php?t=77124

https://pagure.io/koji/issue/1521

1 个赞