termux专用的glibc

发布时间 2023-03-27 13:43:40作者: 伊索

termux专用的glibc


在Termux中运行 aarch64/arm64 的二进制文件时,会提示

bash: /data/data/com.termux/files/home/bin/bb: cannot execute: required file not found

用 ldd 命令检查

apt install ldd -y
ldd ~/bin/bb

libdl.so.2 => not found
libpthread.so.0 => not found
libc.so.6 => not found
ld-linux-aarch64.so.1 => not found

 

可以看出 ~/bin/bb 缺少运行库或者是编译的库文件、二进制文件和运行环境不匹配的原因

使用 glibc-for-termux 能使部分程序运行起来,如果不能运行的尝试编译


这里誊抄使用方法

安装步骤:
pkg ins pacman -y # necessary
pkg ins proot -y # needed only when installing packages that have hard links

wget https://github.com/Maxython/glibc-for-termux/releases/download/20221025/gpft-20221025-${arch}.tar.xz
tar xJf gpft-20221025-${arch}.tar.xz


如果你选择了在 termux 中编译的包,那么安装应该像这样进行:
pacman -U glibc-for-termux/*

如果软件包是在 linux 发行版中编译的,那么安装应该像这样进行:
proot --link2symlink pacman -U glibc-for-termux/*

 

使用方法:
- 运行二进制文件

grun ~/bin/bb

- 运行定制的 shell(可以访问 glibc 命令)
grun --shell