Skip to content

dotnet-install.sh doesn't work on Alpine Linux v3.7 #9171

Closed

Description

@ghost

Steps to reproduce

docker run -it alpine:latest

# in container
apk update
apk add curl bash

curl -O https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh
chmod 777 dotnet-install.sh
./dotnet-install.sh

# errors
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libssl. Install libssl to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continue
dotnet_install: Error: Unable to locate libcurl. Install libcurl to continue

apk add libunwind-dev openssl-dev icu-libs curl-dev
./dotnet-install.sh


# same errors
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libssl. Install libssl to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continue
dotnet_install: Error: Unable to locate libcurl. Install libcurl to continue

Expected behavior

it installs dotnet.

Actual behavior

it doesn't install dotnet.
Reason is we are using /sbin/ldconfig, which on alpine does not locate the installed libs (although i can find all of these under /usr/bin). According to maintainers in alpine's IRC channel (cc @ncopa), this script is not meant to locate the libs reliably (but its purpose is to create some symlinks). The correct way is to use scanelf -qS /usr/lib | grep libunwind etc.

Workaround

Manually install dotnet from tarball as described here: PowerShell/PowerShell#6367 (comment)

Environment data

alpine linux 3.7

Activity

  1. livarcocc commented on Mar 14, 2018

    @livarcocc
    Contributor
  2. omajid commented on Mar 14, 2018

    @omajid
    Member

    (Not speaking on behalf of anyone but myself)

    Reason is we are using /sbin/ldconfig, which on alpine does not locate the installed libs

    Perhaps we should add a flag to dotnet-install.sh to not check for pre-requisites, or only warn, not abort, if they are not found. Or maybe we can try both approaches in dotnet-install.sh: see if scanelf is around and prefer that, then fall back to ldconfig.

    Should we add the same kind of helper script next to dotnet-install.sh and use it in alpine?

    That makes sense, at least in the short term.

    One note on scanelf vs ldconfig: On most Linux distributions, ldconfig is part of the libc package, so it is very very likely to be installed by default on those systems. scanelf is part of pax, which is much less likely to be already installed. So switching from ldconfig to scanelf will break those use cases because dotnet-install.sh will fail on those systems because scanelf will not be found.

  3. transferred this issue fromdotnet/clion Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions