Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Termux: Linux Applications on Android (lwn.net)
79 points by matheusmoreira on Nov 19, 2023 | hide | past | favorite | 33 comments


I recently installed XFCE on my Termux and made it look like Windows 95: https://lemmy.nz/pictrs/image/06550c17-1446-4acc-988f-9541fe...


Jazz <3


Termux is the main thing I miss when I’m using iOS instead of Android.

It’s a shame that Google tightening Android’s security made Termux stuck with an older API (this is why also it is not available on the Play store anymore).

Because of this, I’m not sure if it has a long term future. I’m sure the community will do its best but most likely we will get a less capable version similar to what happened with ad blocking on Chrome.


If Google breaks Termux, I'll buy an iPhone the very next day. It's the only still keeping me in the increasingly locked down Android ecosystem.


One option could be using proot or pKVM to run a full-fledged Linux distro and packages, instead of the limited Termux packages.

But of course, there's no guarantee that it would still work in the future.


Is pKVM available outside of pixel phones by now? There was some hype almost two years ago, e.g. https://www.androidauthority.com/windows-11-android-13-31079..., however I haven't seen a way to actually get it on any non-Pixel 6 device. That seems like it could be potentially really useful, e.g. new linux on DeX, windows on DeX, maybe even desktop photoshop.


I use termux to ssh and attach to tmux session on my desktop. Amazing that it scales well akin to responsive CSS

I had some long running task that required mostly waiting, checking the result, typing some commands and restarting - thanks to this setup I didn't have to stick around my PC


To make termux-emacs touchscreen friendly, you need these

    (xterm-mouse-mode 1)
    (global-set-key (kbd "<mouse-5>") 'scroll-up-command)
    (global-set-key (kbd "<mouse-4>") 'scroll-down-command)


I use Termux/rsync to backup my photos: https://b.tuxes.uk/termux-rsync-photos.html

It works great!


Termux is amazing, I'm able to run my VAX/VMS 11-780 machine on my phone now, thanks to it and SimH. I always wanted a VAX, now I have one in my pocket. 8)

I really appreciate the keyboard handling they add, so you can do almost everything you'd normally need a real keyboard for, on a magic glass slab.


What do you do with a VAX machine on your phone?


Not much, but it's only about 16 Gb of space, and it makes me happy. 8)

Eventually I would like to see it run STOIC and Teco, if I can figure out how to get the appropriate languages and libraries installed.

I have a fondness for Teco for some reason. It was the tool of the ancients back in my student days.

I think it's mostly nostalgia.


I've been using Termux to run personal finance app as a python web service for 3 years. It's so much easier to develop comparing with native options.

Or how about getting access to all SMSs via CLI from a bank to create a nice CVS export with all spending transactions.


> how about getting access to all SMSs via CLI from a bank

How to do that?


termux-sms-list command allows to get access to SMS.


I use Termux all the time on my Amazon Kindle Fire tablet. Turns it into a nice console (text) based Linux box.

I have gotten it to run GUI programs via Termux/X11 or VNC, but my touchscreen only setup makes that awkward. (I'm running base TWM X11, and I've installed an on screen keyboard, but it's all rather slow.)

You can get such tablets for less than $100. Probably you can get generic Android tablets for little $$ these days, but I already had the Kindle. It's quite the advertising platform, but still it's great for casual text-based Linux Python etc programming.


Moved away from Termux because of the lack of storage space on my device (have a very sizable collection of local music). When I get a new phone, with a larger storage capacity, I'll be installing it again right away! I miss using it.



I'm not sure what you are trying to say. Termux is about bringing GNU and other apps to Android, no need to build against the NDK you linked.


Read the first link why Termux cannot do Android 10 and later.

Later editions have more restrictions in place, after the safe systems programming effort has started.


> Read the first link why Termux cannot do Android 10 and later.

Because of the addition of SELinux ruleset restricting a system call. This has nothing to do with whether Android uses GNU or is similar to desktop Linux. Can enable SELinux and this configuration on a GNU/Linux system just fine.


Not only, seccomp and other mechanisms actively killing use of non official APIs, or access to out of bounds system areas.


Is that what you were trying to say? If that's the case, I'm happy to report that you are misinformed: they have worked around that. Termux works flawlessly on my Android 14 phone.


Only because it's built against a previous API version which later versions of Android deign to support for now. Eventually it will pop up a scary "This app was built for an earlier version of Android and may not work properly" box; a short time later it will stop working altogether.

Android should really just go the "curated app store" route like Apple.


> Android should really just go the "curated app store" route like Apple.

I'll buy an iPhone if Android goes down that path. If I must be in some walled garden, I'll choose the better kept garden.

Remote attestation is bad enough but breaking Termux will be the last straw for me.


Same, used it just yesterday on Android 12.


Discovering Termux some years back (probably around 2015/2016) was an absolute watershed for me. It was and remains the one Android app which does not specifically and precisely suck[1].

Commenting on the LWN treatment: do install from F-Droid (I believe this is the only real option that works for now). The Termux-API package is particularly useful, especially the clipboard interactions (I've mapped these to aliases / shell functions / scripts 'xc' (copy) and 'xp' (paste) respectively), and the ability to invoke "open" on specific arguments (e.g., ebooks in multiple formats, or URLs). It's also worth emphasizing that most of your Termux updates are going to be through its package manager (apt or pkg), rather than by updating the underlying Android apps. Effectively you're installing an environment and package manager, and it's these which you'll be using as on a Debian-based Linux distribution to install and update specific packages.

With pip (python's package manager) I also gain access to mpv and yt-dlp, which enable me to play videos (or more accurately, the audio stream from them) from a terminal session rather than as a full-screen application. Given that I'm almost always on an e-ink device for which video which, whilst possible is almost always subobptimal, that's a major win. It also avoids YouTube ads ;-)

Other development package managers (e.g., Ruby, Perl, Rust, etc.) are also available.

The sheer number of available packages is also impressive, well over 2,500 within apt/pkg alone (and far more under additional language-specific repos). That's still a small fraction of a full Debian distro's 70k or so distinct packages, but includes a large and quite useful portion of the actual usable userland tools, including significant dev tools.

I've also found that stability of Termux sessions (that is, avoiding getting reaped by Android's memory garbage collector / process reaper) has improved tremendously over the years, and is rarely a concern (though it may still occur occasionally for a long-stagnant session).

Paring Termux with a larger screen (Android-based e-book / e-ink devices are excellent) and an external bluetooth keyboard is also hugely useful.

There remain limitations: access to full Android storage, root access, an unusual path prefix, many unavailable packages, limited access to systems space (e.g., /proc and /sys, networking, and the like), as well as the underlying Android weirdness do still intrude if you try to stretch limits. But Termux is absolutely useful and an absolutely welcome addition to any Android system.

For those familiar with extending Linux userlands to Windows prior to WSL, it's similar in general spirit to Cygwin.

________________________________

Notes:

1. As I've noted (with some variation) for years: <https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...>. I'll admit that EinkBro, an e-ink optimised browser, is giving Termux a run for its money however: <https://github.com/plateaukao/browser>, which has some truly useful features (such as "save to ePub": <https://toot.cat/@dredmorbius/107958709435468728>). Multiple raves and comments: <https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...>.


In response to [1], Mixplorer is an incredible file explorer. I wish it was FOSS, but it an excellent interface, works well, and has built in servers so that I can easily transfer my data to other computers.

Furthermore, I install packages from F-Droid whenever I can, and my overall mobile experience ia clean, unintrusive, and secure.

There are some shitty apps out there, but thanks to the efforts of all the Android developers, you usually don't have to use them.


Midnight Commander (mc) and lftp (using the fish:// protocol) are terminal-mode file managers which can transfer content between local and remote systems. There's also rsync, of course. All are available under Termux.

There's also the dolphin file manager, also terminal-based, which is either directly available or may be installed under pip (Python's package manager), I don't recall which offhand.

I tend to steer first to the first set, but dolphin's impressed me in the past.

All are FS/OSS.

I appreciate your recommendation, and yes there are times when a native Android GUI interface may be more useful. But if you're already flying Termux, full power of a keyboard and text interface may be preferable.

I also strongly agree that F-Droid is a preferable package manager and repository. I avoid the Google Play Store for all but a very small handful of packages (and generally avoid installing apps where at all possible regardless), and access Google Play Store when I do need to use it through the Aurora Store interface (itself installable & upgradable under F-Droid).

After over a quarter-century of experience with the Debian package repos, the experience of the commercially-oriented, surveillance-capitalism-based Android app store remains a very uncomfortable shock and disappointment.


Could someone check whether they can install numpy and pandas on a termux python?

It didn’t like it last time I tried. Some issue with wheel


Or just use regular Python app, Pydroid, made to work within Android world.


You could try nix-on-droid.


It is particularly useful to run Transmission and download torrents .




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: