0

There are two rpm repos in my CentOS 8.1.1911. Details are as follows:

# virt-1.repo
[appstream]
name=CentOS Linux 8-stream - AppStream
baseurl=http://mirrors.ustc.edu.cn/centos/8-stream/AppStream/$basearch/os/
gpgcheck=0
enabled=1
# virt-2.repo
[centos-advanced-virtualization]
name=CentOS Linux 8-stream - Advanced Virtualization
baseurl=http://mirrors.ustc.edu.cn/centos/8-stream/virt/$basearch/advancedvirt-common/
gpgcheck=0
enabled=1

The two repos both contain the package libvirt, and there are newer one in the repo centos-advanced-virtualization. My operation is as follows:

  1. yum clean all && yum makecache
  2. yum list libvirt --showduplicates, but I get the older one from appstream
# yum list libvirt --showduplicates
Last metadata expiration check: 0:00:18 ago on Sun 26 Sep 2021 05:22:42 PM CST.
Available Packages
libvirt.x86_64                                                 6.0.0-35.module_el8.5.0+746+bbd5d70c                                                 appstream
libvirt.x86_64                                                 6.0.0-36.module_el8.5.0+821+97472045                                                 appstream
  1. remove appstream, mv virt-1.repo virt-1.repo.bak && yum makecache
  2. yum list libvirt --showduplicates, and I can get the newer one from centos-advanced-virtualization
# yum list libvirt --showduplicates
Last metadata expiration check: 0:00:30 ago on Sun 26 Sep 2021 05:26:08 PM CST.
Available Packages
libvirt.x86_64                                                  7.0.0-9.el8s                                                   centos-advanced-virtualization
libvirt.x86_64                                                  7.0.0-13.el8s                                                  centos-advanced-virtualization
libvirt.x86_64                                                  7.0.0-14.el8s                                                  centos-advanced-virtualization
libvirt.x86_64                                                  7.4.0-1.el8s                                                   centos-advanced-virtualization
libvirt.x86_64                                                  7.5.0-1.el8s                                                   centos-advanced-virtualization
libvirt.x86_64                                                  7.6.0-2.el8s                                                   centos-advanced-virtualization

So, why can't I get the newer one at the beginning? Did I miss something?

freshMan
  • 11
  • 1

1 Answers1

1

I solved this problem from here:

The major reason why DNF wants to install MariaDB from AppStream is that it has a preference for modular packages. Which means, that if specific packages (names) or virtual provides are part of a module, and there are packages with the same names available from other repositories and they are not part of the module, then DNF will always want to install packages from the modular repository.

So, that's why I can't get the latest-version libvirt package. After updating my virt-2.repo as follows, everything is fine:

# virt-2.repo
[centos-advanced-virtualization]
name=CentOS Linux 8-stream - Advanced Virtualization
baseurl=http://mirrors.ustc.edu.cn/centos/8-stream/virt/$basearch/advancedvirt-common/
gpgcheck=0
enabled=1
module_hotfixes=1

I can get latest-version libvirt:

# yum list libvirt --showduplicates
Last metadata expiration check: 0:45:51 ago on Mon 27 Sep 2021 06:53:12 PM CST.
Available Packages
libvirt.x86_64                                              6.0.0-35.module_el8.5.0+746+bbd5d70c                                               appstream     
libvirt.x86_64                                              6.0.0-36.module_el8.5.0+821+97472045                                               appstream     
libvirt.x86_64                                              7.0.0-9.el8s                                                                       Virtualization
libvirt.x86_64                                              7.0.0-13.el8s                                                                      Virtualization
libvirt.x86_64                                              7.0.0-14.el8s                                                                      Virtualization
libvirt.x86_64                                              7.4.0-1.el8s                                                                       Virtualization
libvirt.x86_64                                              7.5.0-1.el8s                                                                       Virtualization
libvirt.x86_64                                              7.6.0-2.el8s                                                                       Virtualization
freshMan
  • 11
  • 1