Skip to content

installdependencies.sh: add fallback to libssl-dev / libicu-dev for Debian 14+ #4600

Description

@xuxiaowei-com-cn

Describe the bug

src/Misc/layoutbin/installdependencies.sh uses hardcoded, versioned package names for OpenSSL and ICU libraries:

  • OpenSSL: tries libssl3t64$libssl3$libssl1.1$libssl1.0.2$libssl1.0.0$ (line 105)
  • ICU: tries libicu80libicu79 → … → libicu52 (line 113)

On Debian 14 (and potentially other newer distributions), none of these versioned packages may exist. The script has no fallback to the unversioned development packages (libssl-dev, libicu-dev) which are available on these systems.

When all fallbacks are exhausted, the script exits with:

Can't install dotnet core dependencies.

This blocks self-hosted runner setup on Debian 14.

To Reproduce

  1. Set up a Debian 14 (or newer) system.
  2. Run sudo ./src/Misc/layoutbin/installdependencies.sh
  3. Observe failure — none of the versioned libssl* or libicu* packages can be found by apt-get.

Expected behavior

The script should fall back to the development packages (libssl-dev, libicu-dev) when none of the versioned runtime packages are available. The -dev packages are the canonical unversioned names and are available across all Debian/Ubuntu versions.

Alternatively (or additionally), the script could use apt-cache search / apt list to dynamically discover the available library package names at runtime instead of maintaining a hardcoded list.

Proposed Fix

In the Debian-based branch (after line 69), add a final fallback that tries the -dev packages before failing:

# After the existing fallback chain fails, try -dev packages
apt_get_with_fallbacks libssl-dev
if [ $? -ne 0 ]; then
    echo "'$apt_get' failed to install libssl"
    print_errormessage
    exit 1
fi

apt_get_with_fallbacks libicu-dev
if [ $? -ne 0 ]; then
    echo "'$apt_get' failed to install libicu"
    print_errormessage
    exit 1
fi

A more robust approach would be to query available packages dynamically:

# Find available libssl package
SSL_PKG=$(apt-cache search '^libssl[0-9]' | head -1 | cut -d' ' -f1)
if [ -n "$SSL_PKG" ]; then
    $apt_get install -y "$SSL_PKG"
fi

Runner Version and Platform

  • Version of runner: latest (main branch, commit c814d7ca)
  • OS: Debian 14 (and any future Debian/Ubuntu versions where versioned so-names change)

What's not working?

The installdependencies.sh script cannot install required .NET dependencies on Debian 14 because:

Package type Hardcoded names in script Available on Debian 14
OpenSSL libssl3t64, libssl3, libssl1.1, libssl1.0.2, libssl1.0.0 libssl-dev
ICU libicu80libicu52 libicu-dev (or libicu74 etc.)

Additional context

  • The Debian-based branch starts at line 45 of the script.
  • The apt_get_with_fallbacks function (line 77–95) tries each argument in order but gives up if none succeeds.
  • This pattern has the same maintenance burden as the ICU version list — each new Debian/Ubuntu release may introduce a new soname and break the script again.
  • Using the -dev packages as a final fallback avoids this maintenance treadmill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions