(termux) run a gnu/linux box in your android smartphone - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: September 24, 2025, 01:56:36 pm
content: There is a nice app on Google AppStore: TerMuxIt somehow allows you to have a sort of "container" where you can run GNU/Linux applications.Code:Welcome to TermuxDocs: https://doc.termux.comCommunity: https://community.termux.comWorking with packages:- Search: pkg search <query>- Install: pkg install <package>- Upgrade: pkg upgradeReport issues at https://bugs.termux.comso you can install nano, clang(gcc), binutils, openssh, ...it's not too badjust there are weird things under the hoodyour root is actually at /data/data/com.termux/filesthe sshd port is 8022 and you can't use port 22chroot new_root returns "bad syscall"hostname foo returns "bad syscall"hard links do not workbut you can compile stuffCode:mg85 ~/mydev/hallo # gcc -vclang version 20.1.8Target: aarch64-unknown-linux-android30Thread model: posixInstalledDir: /data/data/com.termux/files/usr/binCode:mg85 ~/mydev/hallo # makecompiling hallo ... donemg85 ~/mydev/hallo # file output/hallooutput/hallo: ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), for Android 30, built by NDK r28c (13676358), not stripped(tested on Motorola Moto-g85)

author: DiTBho
author_rank: Super Contributor
timestamp: September 30, 2025, 09:07:18 pm
content: can't update/modify /etc/hosts, it's readonly!worse still, there is a copy in /data/data/com.termux/files/etc/hosts, but ping doesn't seem to use this filemakes no sense

author: DiTBho
author_rank: Super Contributor
timestamp: October 01, 2025, 09:36:22 am
content: Quote from: DiTBho on September 30, 2025, 09:07:18 pmdiscussedhereon Reddit

author: DiTBho
author_rank: Super Contributor
timestamp: October 01, 2025, 09:40:45 am
content: proot, seehere

author: JohanH
author_rank: Frequent Contributor
timestamp: October 01, 2025, 12:39:01 pm
content: Been a long time user. Very handy for network stuff etc.There is native Linux for Android 16 (through a container, I think). Using that, you will get an even better terminal. At least Pixel phones should have it. My Samsung was updated to 16, but of course they kept the original Android 14 6.1 kernel, so no support yet. There are rumours they will update to a newer Android 16 kernel, but who knows. It sucks that phones can't automatically get the latest kernel, meanwhile my PC and servers receive several updates every month. (And yes, this has been discussed to length many years ago, and especially kernel devs (such as Greg Kroah-Hartman) have made big efforts to encourage phone manufacturers, hardware vendors (such as Qualcomm) and Google/Android to make it easier to upgrade the kernel. The situation is much better than 10 years ago.)

author: DiTBho
author_rank: Super Contributor
timestamp: October 01, 2025, 05:04:39 pm
content: Quote from: DiTBho on September 24, 2025, 01:56:36 pmI tried to move the Gentoo Portage, but it just hangs because it makes use of hardlinks, and since the underlying filesystem does not allow hardlinks, then the Portage just crashes.I don't have a solution for this yet

author: DiTBho
author_rank: Super Contributor
timestamp: October 01, 2025, 05:06:06 pm
content: Quote from: JohanH on October 01, 2025, 12:39:01 pmnmap is too limited

author: DiTBho
author_rank: Super Contributor
timestamp: October 01, 2025, 05:10:12 pm
content: Code:# echo $PATH/data/data/com.termux/files/usr/bin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbinthat's weird, anyway ... it's how it works

author: DiTBho
author_rank: Super Contributor
timestamp: October 01, 2025, 09:09:45 pm
content: Code:localhost / # emerge --search cmatrixPermission denied: '[Errno 13] Permission denied: '/var/db/.pkg.portage_lockfile' -> '/var/db/..pkg.portage_lockfile.hardlock-localhost-13363''seethisbug (#774384)