Multiple packages installing the same file

How is conda supposed to handle multiple packages installing the same file? With rpm it would result in an error about conflicting files, but conda (or at least micromamba) seems to just emit a warning:

The following files were already present in the environment:
    - lib/liblzma.so.5

And it is installed by two different packages:

liblzma-5.8.1-hb9d3cd8_0.json:        "lib/liblzma.so.5",
liblzma-5.8.1-hb9d3cd8_0.json:        "lib/liblzma.so.5.8.1"
liblzma-5.8.1-hb9d3cd8_0.json:                "_path": "lib/liblzma.so.5",
liblzma-5.8.1-hb9d3cd8_0.json:                "_path": "lib/liblzma.so.5.8.1",
xz-5.2.6-h166bdaf_0.json:        "lib/liblzma.so.5",
xz-5.2.6-h166bdaf_0.json:        "lib/liblzma.so.5.2.6",
xz-5.2.6-h166bdaf_0.json:                "_path": "lib/liblzma.so.5",
xz-5.2.6-h166bdaf_0.json:                "_path": "lib/liblzma.so.5.2.6",
lrwxrwxrwx. 1 root root     16 Sep 17  2024 lib/liblzma.so -> liblzma.so.5.2.6*
-rwxrwxr-x. 2 root root 222712 Apr  4 06:51 lib/liblzma.so.5*
-rwxrwxr-x. 2 root root 180952 Aug 12  2022 lib/liblzma.so.5.2.6*
-rwxrwxr-x. 2 root root 222712 Apr  4 06:51 lib/liblzma.so.5.8.1*

This should be fixed once Extend xz_split scope by xhochy · Pull Request #1021 · conda-forge/conda-forge-repodata-patches-feedstock · GitHub has been merged. Now liblzma ensures that it is only co-installed with the same version of xz where the files are split correctly.

Thanks for the update, hopefully that will help. But I imagine that part of the issue is that I’m ending up with a very old version of xz for some reason - 5.2.6 when the latest is 5.8.1. I’m not even sure why I’m ending up with xz in the environment in the first place.

I’m still a bit flabbergasted that conda allows this to happen in the first place. I would have thought that one of the primary functions of a package manager is to not corrupt the integrity of the installation.

@opoplawski,

You can set the path_conflict configuration parameter to prevent if this isn’t the behavior you want. It defaults to clobber which is the behavior you’re currently seeing.

Here’s more about that configuration parameter:

# # path_conflict (PathConflict)
# #   The method by which conda handle's conflicting/overlapping paths
# #   during a create, install, or update operation. The value must be one
# #   of 'clobber', 'warn', or 'prevent'. The '--clobber' command-line flag
# #   or clobber configuration parameter overrides path_conflict set to
# #   'prevent'.
# # 
# path_conflict: clobber