Package conflicts due to included build-ids

Latest response

Hi everybody,

the situation is the following: I have two RPM packages to install on a RHEL 8.5 machine.

  1. gitlab-ee from
➜  ~ yum --noplugins repolist -v --repo gitlab_gitlab-ee
YUM version: 4.7.0
cachedir: /var/cache/dnf
Repo-id            : gitlab_gitlab-ee
Repo-name          : gitlab_gitlab-ee
Repo-updated       : Tue 07 Dec 2021 12:26:11 AM CET
Repo-pkgs          : 202
Repo-available-pkgs: 202
Repo-size          : 175 G
Repo-baseurl       : https://packages.gitlab.com/gitlab/gitlab-ee/el/8/x86_64
Repo-expire        : 300 second(s) (last: Wed 08 Dec 2021 03:38:20 PM CET)
Repo-filename      : /etc/yum.repos.d/gitlab_gitlab-ee.repo
Total packages: 202
  1. td-agent from
➜  ~ yum --noplugins repolist -v --repo treasuredata
YUM version: 4.7.0
cachedir: /var/cache/dnf
Last metadata expiration check: 0:53:52 ago on Wed 08 Dec 2021 02:51:07 PM CET.
Repo-id            : treasuredata
Repo-name          : TreasureData
Repo-revision      : 1638509802
Repo-updated       : Fri 03 Dec 2021 06:36:42 AM CET
Repo-pkgs          : 6
Repo-available-pkgs: 6
Repo-size          : 84 M
Repo-baseurl       : http://packages.treasuredata.com/4/redhat/8/x86_64
Repo-expire        : 172,800 second(s) (last: Wed 08 Dec 2021 02:51:07 PM CET)
Repo-filename      : /etc/yum.repos.d/td.repo
Total packages: 6

Now, if I installed one of them, installing the other causes an error. In my case, I have gitlab-ee installed and tried to install td-agent:

Error: Transaction test error:
  file /usr/lib/.build-id/43/628674f17ad8eef26bdfe36f12978af5c53c4a from install of td-agent-4.2.0-1.el8.x86_64 conflicts with file from package gitlab-ce-14.2.0-ce.0.el8.x86_64
  file /usr/lib/.build-id/4b/41a98372f36876cd1be483fa30caddeb0c3d5f from install of td-agent-4.2.0-1.el8.x86_64 conflicts with file from package gitlab-ce-14.2.0-ce.0.el8.x86_64
  file /usr/lib/.build-id/6c/c52279cc0c5eb99a5330fe3e093851f62d6715 from install of td-agent-4.2.0-1.el8.x86_64 conflicts with file from package gitlab-ce-14.2.0-ce.0.el8.x86_64
  file /usr/lib/.build-id/ce/3452804469ea64798b8df6a5d35400170b04ef from install of td-agent-4.2.0-1.el8.x86_64 conflicts with file from package gitlab-ce-14.2.0-ce.0.el8.x86_64

Apparently, both packages contain the same files in /usr/lib/.build-id/ which are symbolic links to some binaries. Let's see what hides behind those links:

➜  ~ readlink --canonicalize /usr/lib/.build-id/43/628674f17ad8eef26bdfe36f12978af5c53c4a
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/3.0/nokogiri.so
➜  ~ readlink --canonicalize /usr/lib/.build-id/4b/41a98372f36876cd1be483fa30caddeb0c3d5f   
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/2.7/nokogiri.so
➜  ~ readlink --canonicalize /usr/lib/.build-id/6c/c52279cc0c5eb99a5330fe3e093851f62d6715
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/2.5/nokogiri.so
➜  ~ readlink --canonicalize /usr/lib/.build-id/ce/3452804469ea64798b8df6a5d35400170b04ef
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/2.6/nokogiri.so

Okay, and what is included in td-agent?

➜  ~ repoquery --list td-agent | grep 'nokogiri-1.11.7-x86_64-linux/lib/nokogiri/[[:digit:]].[[:digit:]]/nokogiri.so'
Last metadata expiration check: 0:00:47 ago on Wed 08 Dec 2021 03:54:35 PM CET.
/opt/td-agent/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/2.5/nokogiri.so
/opt/td-agent/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/2.6/nokogiri.so
/opt/td-agent/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/2.7/nokogiri.so
/opt/td-agent/lib/ruby/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/lib/nokogiri/3.0/nokogiri.so

Thus, both packages ship their own ruby distributions which include several nokogiri gems, but they also include build-ids for nokogiri as symbolic links, with the links in gitlab-ee pointing to nokogiri binaries from ruby shipped with gitlab-ee and the links in td-agent to binaries from ruby shipped with td-agent.

After research, it seems that the only way to work around it is to install the packages manually using rpm --install --replacefiles. But this is a bad solution since I can no longer update my system with yum update.

Please help me to figure out how to tackle this issue.

Responses