Common problems and how to fix them.
Symptom:
gyp: Call to 'pkg-config --cflags libsecret-1' returned exit status 1
Fix:
pkg install libsecret
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${PREFIX}/share/pkgconfig"
# Then re-run the installer
./install.shThe installer sets PKG_CONFIG_PATH automatically, but if you are building manually you must export it first.
Symptom:
error: use of undeclared identifier 'openpty'
or clang version errors.
Fix:
pkg install clang
clang --version # should be 14 or higherIf clang is already installed at the wrong version:
pkg upgrade clangSymptom:
✗ Failed to install sharp
Impact: Non-fatal. Copilot CLI still works; only image-rendering features are affected.
Fix (optional):
pkg install libvips rust
npm install sharpIf Rust is outdated, update it:
pkg upgrade rustSymptom:
/usr/bin/env: bash: unbound variable
or errors like npm: unbound variable: NPM_CONFIG_...
What the installer does: All npm calls in install.sh are already wrapped with set +u before and set -u after. If you are calling npm directly in a set -u shell, wrap your calls:
set +u
npm install something
set -uSymptom:
bash: ./install.sh: Permission denied
Fix:
chmod +x install.sh
./install.shSymptom:
Error: This setup script must be run inside Termux (TERMUX_VERSION not set). Exiting.
Fix: Make sure you are running the script inside the Termux app, not in a regular Linux terminal or SSH session that is not Termux. The TERMUX_VERSION environment variable is set automatically by Termux.
Symptom:
npm ERR! network request to https://registry.npmjs.org failed
Fix:
# Update pkg first
pkg update && pkg upgrade
# Check connectivity
curl -I https://registry.npmjs.org
# Retry the installer
./install.shSymptom: Copilot reports it cannot find rg, or:
⚠ No system rg found; Copilot may fail to use ripgrep
Fix:
pkg install ripgrep
which rg # should output a path
./install.sh # re-run to create the Copilot symlinkSymptom: /paste in Copilot CLI returns empty string.
Checks:
- Make sure the Termux:API companion app is installed (from F-Droid).
- Grant Termux:API the clipboard permission in Android Settings → Apps → Termux:API → Permissions.
- Test manually:
termux-clipboard-get echo "hello" | termux-clipboard-set termux-clipboard-get # should print "hello"
The full installation log is written to:
~/.copilot-termux-install.log
Attach this file when reporting issues.