Skip to content

Doesn't run on Ubuntu 20.04? (Glibc Version Mismatch) #238

Closed

Description

@Bewinxed

After installing and adding the Claude Code oauth.

bun i -g ........
opencode
/.cache/opencode/tui/tui-yarjvbbb.: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /.cache/opencode/tui/tui-yarjvbbb.)
/.cache/opencode/tui/tui-yarjvbbb.: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /.cache/opencode/tui/tui-yarjvbbb.)

I'm upgrading rn to 22 but I think this could be put somewhere if there's an error.

Activity

  1. changed the title [-]Doesn't run on Ubuntu 20.04?[/-] [+]Doesn't run on Ubuntu 20.04? (Glibc Version Mismatch)[/+] on Jun 20, 2025
  2. self-assigned this
    on Jun 20, 2025
  3. Bewinxed commented on Jun 22, 2025

    @Bewinxed
    Author

    Can confirm upgrading to Ubuntu 22 solved it (Though i half bricked my vps in the process but we ball 🏀)

  4. uthmanmoh commented on Jul 2, 2025

    @uthmanmoh

    I'm having this same issue. Is there any workaround to this, like building from source or anything?

    ❯ ldd --version
    ldd (GNU libc) 2.26
    
  5. thdxr commented on Jul 3, 2025

    @thdxr
    Member

    i dropped the glibc requirement in 0.1.179

  6. ferrants commented on Aug 6, 2025

    @ferrants

    Did the glibc requirement get added back recently? I get errors now when opencodev tries to run commands

  7. added a commit that references this issue on Jan 4, 2026
  8. justinclift-prvidr commented on Jan 23, 2026

    @justinclift-prvidr

    Yeah, the glibc requirement is definitely a current thing in at least OpenCode 1.1.31 and 1.1.32:

    $ /usr/bin/OpenCode
    /usr/bin/OpenCode: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /usr/bin/OpenCode)
    

    This is on a variant of Ubuntu 22.x.

    The above is a bit of a problem as there doesn't seem to be an AppImage available for download these days either.

    I'll try the musl version next just to see if that works, and if not then building from source might be the right approach for testing this software out. 😄

  9. pedropombeiro commented on Jan 24, 2026

    @pedropombeiro

    I was able to build the required executable on the target system using the following Dockerfile (linux/amd64 target):

    # Build on linux/amd64 to ensure correct baseline binary
    FROM --platform=linux/amd64 oven/bun:1.3.5-debian AS builder
    
    RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
    
    WORKDIR /build
    RUN git clone --depth 1 https://github.com/anomalyco/opencode.git .
    
    RUN bun install
    RUN ./packages/opencode/script/build.ts
    
    # Get musl and libs from Alpine
    FROM --platform=linux/amd64 alpine:latest AS musl
    RUN apk add --no-cache musl libstdc++ libgcc
    
    FROM alpine:latest AS wrapper
    COPY opencode /opencode/opencode
    RUN chmod +x /opencode/opencode
    
    FROM scratch AS export
    COPY --from=builder /build/packages/opencode/dist/opencode-linux-x64-baseline-musl/bin/opencode /opencode/bin/opencode.bin
    COPY --from=musl /lib/ld-musl-x86_64.so.1 /opencode/lib/
    COPY --from=musl /usr/lib/libstdc++.so.6 /opencode/lib/
    COPY --from=musl /usr/lib/libgcc_s.so.1 /opencode/lib/
    COPY --from=wrapper /opencode/opencode /opencode/opencode
    #!/bin/bash
    set -e
    
    cd "$(dirname "$0")"
    
    docker build --output type=local,dest=./dist .
    
    echo ""
    echo "Binary exported to ./dist/opencode"
  10. opencode-agent commented on Jan 24, 2026

    @opencode-agent
    Contributor

    User pedropombeiro does not have write permissions

    github run

  11. pedropombeiro commented on Jan 25, 2026

    @pedropombeiro

    The build above can be installed using mise:

    mise install github:pedropombeiro/opencode-legacy-glibc@latest
  12. justinclift-prvidr commented on Jan 27, 2026

    @justinclift-prvidr

    @pedropombeiro Looking over that Dockerfile, that seems like a decent approach. Good stuff. 😄

  13. pedropombeiro commented on Jan 28, 2026

    @pedropombeiro

    @justinclift-prvidr Thanks. By the way, I moved to another repo that is not a fork: https://github.com/pedropombeiro/opencode-legacy-glibc. This will allow scheduled builds to run, so we get the latest versions automatically.

  14. justinclift-prvidr commented on Jan 29, 2026

    @justinclift-prvidr

    Thanks @pedropombeiro , hopefully I'll have time to try it out later on today. Priorities here tend to be shifted around quite dynamically and it's not my focus thing right now any more. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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