an9wer's

A Failed Gentoo Update: Blocked Packages

posted:

2021-12-18

In my recent Gentoo update, the package "net-dns/ldns-utils" was blocked due to a conflict with another package "net-libs/ldns":

# emerge --ask --verbose --update --newuse --deep @world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] net-libs/ldns-1.8.0-r4:0/3::gentoo [1.7.1-r5:0/3::gentoo] USE="dane ecdsa -doc -ed448 -ed25519 -examples% -gost -python -static-libs -vim-syntax" PYTHON_SINGLE_TARGET="python3_9 -python3_8 (-python3_10)" 1,254 KiB
[blocks B      ] <net-dns/ldns-utils-1.8.0-r2 ("<net-dns/ldns-utils-1.8.0-r2" is soft blocking net-libs/ldns-1.8.0-r4)

Total: 1 package (1 upgrade), Size of downloads: 1,254 KiB Conflict: 1 block (1 unsatisfied)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (net-dns/ldns-utils-1.7.1:0/0::gentoo, installed) pulled in by
    net-dns/ldns-utils required by @selected

  (net-libs/ldns-1.8.0-r4:0/3::gentoo, ebuild scheduled for merge) pulled in by
    ldns
    >=net-libs/ldns-1.7.1[dane?,ecdsa?,ed25519?,ed448?,gost?] (>=net-libs/ldns-1.7.1[dane]) required by (net-dns/ldns-utils-1.7.1:0/0::gentoo, installed) USE="dane ssl -ecdsa -ed25519 -ed448 -examples -gost"


For more information about Blocked Packages, please refer to the following
section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage#Blocked_packages

From the error message, it's clear that my system currently has "net-libs/ldns" version 1.7.1-r5 and "net-dns/ldns-utils" version 1.7.1 installed. During the update, "net-libs/ldns" is supposed to upgrade to the version 1.8.0-r4, which, however, introduces a conflict. The updated package includes a restriction - <net-dns/ldns-utils-1.8.0-r2. This means any version of "net-dns/ldns-utils" older than 1.8.0-r2 is incompatible with "net-libs/ldns" version 1.8.0-r4, and both cannot be installed at the same time.

A temporary workaround is to prevent emerge from upgrading "net-libs/ldns" by masking newer versions and keeping the current one. This can be achieved by adding versoin masks:

# ed /etc/portage/package.mask/ldns
a
>net-libs/ldns-1.7.1-r5
.
wq

Another workaround is to upgrade "net-dns/ldns-utils" to a version that satisfies the restriction. The only suitable version currently is 1.8.0-r2, which, However, is marked as unstable, as indicated by KEYWORDS="~amd64" in its source file "ldns-utils-1.8.0-r2.ebuild". Install this version can be achieved by adding accept keywords:

# ed /etc/portage/package.accept_keywords/ldns
a
net-dns/ldns-utils-1.8.0-r0 ~amd64
.
wq

However, neither of these is a perfect solution. Interestingly, I came across some notes in the commit log for "ldns-utils-1.8.0-r2.ebuild":

It is likely that people have ldns-utils in @selected, so let's provide a stub version that depends on a the "consolidated" ldns package until we can last rites ldns-utils.

Bug: https://bugs.gentoo.org/828109

Given that ldns and ldns-utils are built from the same source code, I would suggest consolidating them into a single package. This will avoid any possible issues with mismatched library versions.

So, the underlying issue is that the maintainer has consolidated two packages into one. To resolve this properly, net-dns/ldns-utils should be removed and replaced with the merged package, net-libs/ldns:

# emerge --deselect net-dns/ldns-utils

Thanks for reading :)