--- a/lib/dpkg/arch.c 2026-10-14 12:41:34.729574429 +0800 +++ b/lib/dpkg/arch.c 2026-10-14 12:41:34.729607515 +0800 @@ -62,17 +62,21 @@ internerr("arch name argument is NULL"); if (!*p) return _("may not be empty string"); + /* Termux/Android: Termux names its architectures after the GNU CPU + * name, and two of the four it serves -- x86_64 and aarch64 -- carry an + * underscore. Without this every package in the bootstrap database + * would be reported as having an invalid Architecture. */ if (!c_isalnum(*p)) return _("must start with an alphanumeric"); while (*++p != '\0') - if (!c_isalnum(*p) && *p != '-') + if (!c_isalnum(*p) && *p != '-' && *p != '_') break; if (*p == '\0') return NULL; snprintf(buf, sizeof(buf), _("character '%c' not allowed (only " "letters, digits and characters '%s')"), - *p, "-"); + *p, "-_"); return buf; }