Arduino CLI on Termux (Android) cannot connect to network

Hi everyone,

I’m trying to run Arduino CLI on Termux (Android).
The binary works fine, but I keep running into network issues whenever the CLI tries to fetch indexes or install cores.

For example, running:
arduino-cli core search uno

or

arduino-cli core update-index

Gives me:

Downloading index: package_index.tar.bz2Get "https://downloads.arduino.cc/packages/package_index.tar.bz2": dial tcp: lookup downloads.arduino.cc on [::1]:53: read udp [::1]:46621->[::1]:53: read: connection refused
Downloading index: package_staging_index.jsonGet "https://downloads.arduino.cc/packages/package_staging_index.json": dial tcp: lookup downloads.arduino.cc on [::1]:53: read udp [::1]:42849->[::1]:53: read: connection refusedError initializing instance: Some indexes could not be updated.
Downloading missing tool builtin:mdns-discovery@1.0.9...builtin:mdns-discovery@1.0.9Get "https://downloads.arduino.cc/discovery/mdns-discovery/mdns-discovery_v1.0.9_Linux_ARM64.tar.gz": dial tcp: lookup downloads.arduino.cc on [::1]:53: read udp [::1]:43431->[::1]:53: read: connection refused

What I’ve tried

  • Internet on Termux works fine (ping, curl, wget all succeed).

  • Edited /etc/resolv.conf in Termux to use Google DNS (8.8.8.8, 8.8.4.4) → still the same.

  • Tried export GODEBUG=netdns=cgo before running Arduino CLI → still failing.

  • Manually downloaded package_index.json into ~/.arduino15/ works partially, but CLI still tries to fetch other tools online.

  • Tried configuring proxy in arduino-cli.yaml → still times out, unless a real proxy is running.


My environment

  • Device: Android (running Termux)

  • Arduino CLI: latest release (Linux ARM64 build)

  • Network: works fine for other tools, only Arduino CLI fails


Question

Is there a way to force Arduino CLI on Termux to use a specific DNS / network stack instead of defaulting to ::1?
Or maybe a way to run Arduino CLI fully offline (with manually downloaded cores/tools)?

Any suggestions would be appreciated :folded_hands:

Hi @learningcenter50.

Yes, you can avoid a reliance on the Internet by manually downloading the files.

The index files go in the directories.data folder, the default location of which is at /home/<username>/.arduino15/ on Linux machines. The location can also be configured:

https://arduino.github.io/arduino-cli/latest/configuration/

The archive files for the "built-in" tools like mdns-discovery are stored in the tools subfolder of the directories.downloads folder, the default location of which is the staging subfolder of the directories.data folder.

The archive files for the components of the boards platforms (AKA "cores") installed via arduino-cli core install are stored in the packages subfolder of the directories.downloads folder.

Arduino CLI checks for the presence of the files in the directories.downloads folder before attempting a download from the Internet. So if you manually download the necessary files to that folder, arduino-cli core install will install the built-in tools and platforms from the existing files there instead of attempting a download.