Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

OpenCode on Termux

在 Termux (Android aarch64) 上安装 OpenCode 的教程和一键脚本。

文件

文件 说明
INSTALL-OPENCODE.md 从零安装教程(原理、步骤、常见问题)
install-opencode.sh 一键安装脚本

快速使用

curl -fsSL https://raw.githubusercontent.com/sinskl/opencode-termux-guide/main/install-opencode.sh | bash

或手动安装:

pkg install glibc-repo
pkg update
pkg install glibc curl ripgrep
curl -fsSL https://opencode.ai/install | bash

cat > $PREFIX/bin/opencode << 'EOF'
#!/data/data/com.termux/files/usr/bin/sh
unset LD_PRELOAD
exec /data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1 "$HOME/.opencode/bin/opencode-linux-arm64" "$@"
EOF
chmod +x $PREFIX/bin/opencode

原理

官方 Linux ARM64 二进制依赖 glibc,Termux 使用 Android 的 bionic libc。解决方案:

  1. 安装 Termux 的 glibc 包,提供 ld-linux-aarch64.so.1
  2. 创建包装脚本:unset LD_PRELOAD + 通过 glibc 的动态链接器启动

About

OpenCode on Termux (aarch64) — 安装教程 & 一键脚本

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages