Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Termux is an Android terminal emulator and Linux environment app with no rooting (termux.com)
278 points by ZnZirconium on Nov 3, 2020 | hide | past | favorite | 208 comments


Termux has recently run into issues with Android 10 and the more recent APIs, which break its form of package management.

Their workaround is fairly clever (although not yet implemented) but means that updates to the Play Store version have been temporarily put on hold.

https://github.com/termux/termux-packages/wiki/Termux-and-An...


Comments like this one[1] that mention having difficulty using Termux to access SD cards keep making me feel like we are radically over-securing devices. More and more it feels like the OS, the browser, are guarding the user not against bad apps, but also against the user. Firefox Mobile only allowing less than a dozen extensions. Chrome mobile supporting no extensions. These are different than the OS, but the same kind of decisions done "for the user" by removing capabilities from the environment.

Even the people not fighting against people in the War on General Purpose Computing keep seceding our sovereign systems away from us. The need for security is real, but I don't see that we are approaching it with balance. We seem to be growing ever more heavyhanded, permitting users less & less, and I don't see a reciprocal respect & empowerment being considered, furthered or advanced.

[1] https://news.ycombinator.com/item?id=24982862


What worries me most is that our devices are being radically over-secured according to a threat model that doesn't include companies that share my data without my permission, but does include open source developers building general-purpose tools. The former are actively encouraged, and the latter are considered collateral damage.


That might have something to do with the fact that the people making the OS are also the people most interested in your data.


> More and more it feels like the OS, the browser, are guarding the user not against bad apps, but also against the user.

This is something Stallman and others have been talking about[1] for more than a decade now.

[1] https://news.ycombinator.com/item?id=24881893


Well, I approach it from two angles at once. One, a pocket computer running Linux which, using Termux, could be a full Linux machine - in which I can run Perl scripts on my SMS messages, grep my emails, rename and organize my photo library and so on. Which was presumably mostly possible on old, less secure versions of Android. With Android 10 and its exec restriction, sure you can still install precompiled packages as apk's but what about simply compiling a small C program and running it? So the old school tinkerer is sad that I'm locked out of a perfectly good Linux machine that I own.

However the other angle is, this phone is an appliance and I want it to just work. I'm personally competent enough to have that cake (programmability) and eat it too (reliable usability) - after all I've been running Red Hat/Fedora as my primary desktop OS at home for two decades and it works just fine, thank you. But I also remember what a horrible mess the average schmoe's home computer was back in the good old days... remember an outdated version of Internet Explorer with half the screen obscured by a stack of junky toolbars, and the whole thing running at 800x600 on a monitor capable of higher resolutions "because otherwise the letters are too small". Good riddance.

Anyway for the moment, second-hand desktop and laptop machines that can run a full, unencumbered compute environment are still plentiful. Maybe by the time they aren't, I'll be a truly old fart who doesn't care any more.


I agree that there are multiple angles. I think of them as different contexts. What I see is that, at the moment, we're designing, permitting, allowing, creating, constructing, & securing only for one angle, only for the pure-consumerism mode, the mode where we assume the user is in "don't care/don't know" mode.

This mode, however, is such a denigration to humanity. All the spirit of augmenting the human intellect, computing being servant to the human psyche, harnessed by human creativity... it's a way-more-than-tacit admission of defeat, a brazen retreat. It just seems... unaccounted for. We don't talk about this loss, this turning around. We trumpet security & chalk up wins for helping each other, but there's no mainstream dialogue that supports the deeply enriched angle, the immersive, expert computer user, the post-training-wheels life. Everything is centered around the dumb consumer, all of computing focused around a consumerized applicationized "just work" mentality.

I think we've been drinking poison.


Maybe Android just needs to add support for virtual machines? Then you could have the best of both worlds.


Can the user really achieve "security" without having full control. When the user is not the customer of the third party providing "security". (In this case advertisers are the customer.)

Hopefully courts will begin to recognise that this sort of "security" is in fact created for the benefit of the company and its customers, not users. Any benefits to users are incidental.

Users are not soliciting these "security" measures. They are always initiated by the company.


This is not a part of the war on general purpose computing; it's a part of the effort to make Eternal September to end by making software that works for everyone.

As it is, this entails limiting the users' freedom to tinker in such a way that they simply cannot screw things up no matter how hard they try. Because, you know, if users have that option, then someone will take advantage of it and screw things up.

This line of thought has powerful political and philosophical backing, as digitalization is seen as the magic bullet that will solve a wide array of issues throughout society, and the general idea seem to be to protect people for their own good. Incidentally, it's often the most profitable route as well, as it's the only way to get non-technical users on-board.


> As it is, this entails limiting the users' freedom to tinker in such a way that they simply cannot screw things up no matter how hard they try.

I've had my parents on Ubuntu Linux for a while now for exactly this reason: no matter what they do, they aren't going to screw things up, even if they tried. It just works.

So far there have been no complaints and no issues.


Ditto with my in-laws and Linux Mint. Thing is, they don't really care about tinkering (just like most people) and so they don't care. Allowing them to tinker would benefit them very little, while it would definitely increase the risk of them screwing things up.


That’s the cover story LOL


It's the official story, no matter how you put it. I'm not saying it's a good thing (in fact, I find it horrible), but it is what it is and I have no idea on how to turn that tide.

There's a lot to be said about freedom of computing, but the fact remains that given the option to screw things up, then some people will do that. At the same time, we have a culture that incentivize catering to the non-technical users in a way that prevents them from screwing things up.

Long story short: If we want to turn this trend, then we need to:

1) Start telling non-technical users that any damage caused through their freedom of action is their own responsibility.

2) Produce competitive products that not only provide the desired amount of freedom, but which also compete on price, desirability, usability and the impression that the products are secure enough to use.

In many cases, 1 will be seen as a way of avoiding responsibility, and it'll take a tremendous amount of effort to convince users (and consumer protection agencies) that they should be less protected just in case someone else decides to tinker with their product. That alone makes 2 more or less impossible.


I really think this line of thinking is overegged. It is one thing to make a device easy to use, yet quite another to lock them out for creative purposes.


It's not about making things easy to use, but about making them harder to break. Creative tinkering is simply not taken into the consideration for most consumer products. Things like support load, RMA rate and consumer protection laws is.


Like I say. It’s a cover story. They could make devices serviceable at the same time but it is more convenient for them not to, and to even push the envelope of what’s acceptable.


Could not agree more.

There should be a "I know what I'm doing" switch that disables a bunch of restrictions and essentially enables full root privileges for your user.


Stallman was right.


> Chrome mobile supporting no extensions.

Kiwi browser does.


Reminder that Termux is available on F-Droid.


I've had a terrible experience with my LineageOS S9.


F-Droid's UI is trash in terms of usability IMO. Quite clunky.

If that was your issue too there are various frontend forks that fix that issue in better ways than F-Droid has attempted to. I for one use FoxyDroid which is about as minimal as it gets, but still usable and pretty to look at. There's also AuroraDroid (best looking one IMO), and G-Droid as alternative frontends.


I agree, the big F-Droid redesign was a step backwards. I didn't know about the alternatives though. Thanks


What does that have to do with Termux or F-Droid?


Free associating? I never experienced F-Droid before or since my scattered Cyanogen/LineageOS experiments. Honestly, I doubt I'm alone making that distinction (similar to how its hard to make a distinction between javascript and jquery when you're first learning)

Honestly I'm a little confused about the DIY mobile software landscape, and would love to get a minimalist, open-source wonderland mobile OS - and I wouldn't even mind if it was browser native, and neither should anyone else because WASM.


fdroid is kinda like cydia, repo based but often open source/FOSS stuff you can install as apks on an android OS device.

dont need a special lineage install to get it, seems to work anywhere


Yep. You can even install f-droid on Amazon fireTV sticks using the sideload feature.


I hate the direction Google is taking Android. They're on an appliance-ification quest trying to hide any exposed linux-ness of the OS, including trying to remove developer access to all file handles. They always claim it's in the name of security but my suspicion is that it's an effort to transition from Linux to Fuchsia.


For me so far the worst thing Google did was disabling API for call recording. That makes new phones pretty much useless for me. I always record calls, so that I can go back to them if I forget something or that nobody can claim they said something when they didn't (most recently insurance salesperson told me I will have option X if I take their insurance and they once I bought it, there was no such option. Once I pulled the "I have recorded your salesman lying to me", I got a prompt refund and apologies).


I got around this limitation by using LineageOS. Unfortunately, I'm forced to compile my own builds with call recording enabled for the US because there's no way to tell which state you're in through MNC-MCC numbers and states like California and Pennsylvania have lame two-party consent laws for recording calls[1][2]. My state is single party consent. Just super lame that all my featurephones from the mid-2000's could record without modification.

[1] https://en.wikipedia.org/wiki/Telephone_call_recording_laws#...

[2] File to edit: https://github.com/LineageOS/android_packages_apps_Dialer/bl...


I'm surprised and disappointed LineageOS disables it as well. Do they block apps with the word "torrent" in them as well?


One would think a stern warning dialog would be sufficient...


"This call may be recorded..."


I assume you're up on all the various local laws on recording conversations, so this is for others, not you. Look into it before doing this.


Ok but then why don't they disable the camera and a microphone when you record videos? You can hide the phone in a way that the person you talk to won't see you are recording it. I don't accept this explanation.


Yes, laws overlap. The ones I'm talking about are generally about "intercepting communications" i.e., "recording conversations". In general, the US requires one-party consent, but there are 15 states that require two-party consent.


So you can put your phone on recording e.g. in a restaurant "intercepting communications", but when someone calls you it's a no-no. Regardless, in my country recording is perfectly legal and yet Google has disabled it. If this is the law, then don't you think they should either follow it or not? I am not sure how you can only partially follow the law.


They are doing the lazy thing and configuring it for "lowest common denominator". Yes, it's irritating. The effort to integrate GPS and allow/not-allow would be low.

Maybe it's complicated for telephone conversations where you're not breaking a law locally, but are breaking a law remotely?


I'd rather think that insurance companies and similar who rely on sales over the phone lobbied Google to disable it. The law thing for me is too poorly done to be a valid excuse.


Not against the law in Finland at least and thus seems unfair that rooting is needed to do this.


You may be better off with a VoIP service and a softphone client, though I don't think any are as smooth as the phone native performance


This is more a limitation of smartphone hardware than of Android. In most phones, calls are entirely handled by the baseband processor, and the ARM chip never sees any of the audio data.

Android doesn't expose it because the hardware doesn't expose it to the OS in the first place.


I am not sure if that is true. I am running Samsung S9 with an early Android version and call recording works just fine. The Samsung released an update that disables call recording altogether (and does not allow you to turn off updates, so I've been postponing the OS update for almost two years now every day or so).


DISCLAIMER: It's been some time since I used to read release notes for every new api level

Well... IIRC there was never an official call recording API, and in fact on some phones it was physically impossible to snoop on the telephony audio.

Most recording apps used to either work only on some qualcomm single chip phones where baseband exposed audio path to application processor, or enabled microphone recording in hopes of catching the audio from speakers (and not all phones allowed simultaneous mic use like that).


Ironically, the biggest concern I have with "security" on my Android phone is Google itself. Their overzealous collection of private data makes them a constant liability which I have practically no control over other than to abandon the Android platform altogether. I've ditched Google for almost everything else, but Android is one of the few things which I don't have a reasonable alternative for.


That's why I decided to get a PinePhone this year.


Android was always about Java (now Kotlin).

The NDK was only added in 2.0 to appease game developers and workaround for Dalvik anemic performance.

Any access to Linux APIs was accidental and never part of the official native APIs.


But Java has interfaces for interacting with the host OS, for example you can create a file by writing `new File("myfile").createNewFile()` which makes a Linux call under the hood. Android 11 breaks that File API.


The same API on Windows does a Windows call under the hood, on IBM I does a TIMI call under the hood and on PTC bare metal it does the work itself.

Android ported to any of those platforms would still make use of File("myfile").createNewFile() with zero dependencies on a Linux implementation.

No it doesn't, the API call is still valid in Android 11, as long as the filesystem reserved for the application is used.

Even so, it has to do with the Java implementation.


It's a shame as it you can make much more powerful apps with a native API.


On modern Android Java is native both ways.

It is the main userspace programming APIs are written in. Followed by the increased use of Kotlin.

In both cases, the final execution tier does produce a pure binary, when the device is idle, after getting the PGO data from the JIT tier.

The NDK C and C++ APIs are based on ISO C, ISO C++, OpenGL, Vulkan, OpenSL (now replaced by AAudio), and Android specific native APIs.

Plenty of choice, just not Linux specific APIs.


> They always claim it's in the name of security

Like pretty much everything that goes against the user and people are way too quick to accept anything that has the word "security" applied to it.


I heard somebody mispronounce the color fuchsia as fucks-ya. Seems apt in this case?


The color fuchsia is named after the plant which is names after the German botanist Leonhart Fuchs, whose surname means "fox" and is pronounced roughly "fooks". I strongly suspect that the usual English pronunciation is the result of taboo avoidance. (If it were a regular sound change, you'd expect "axial" to be pronounced "ashal" as well.)


This.


The workaround won't help with self-installed executables though, right? Like when I cross-compile something on my dekstop and copy the executable to run under Termux?


It seems like maybe as long as you package your executable into a DEB it can convert it into an APK? That shouldn't be too hard. It's probably possible for them to release a script that does it automatically depending on what information is preserved from the DEB in the APK with regard to types of files and how complex the thing you want to install is.

I don't have much experience with DEBs, but have quite a bit with RPMs and their spec files which are used to create them, and this wouldn't be that hard to do with an RPM (and you can convert RPMs to DEBs in many cases with utilities).


Yeah I guess that would work as a last resort but it's a pretty big hoop to jump through compared to just scp-ing the binary over. I guess I will stick with SDK 28 builds as long as I possibly can and start looking at alternatives for the longer term.


This is annoying but not actually a big deal; it is easy to work around this with a custom dynamic linker.


If you want to do something other than Instagram then don't buy devices that run "mobile" OSes.


It's easy to say that, but the competition isn't all that great so your comment isn't really adding much.


This is the whole "linux desktop isn't there yet" thing but with phones now.

It's not shiny but it does work. Continuing to use abusive software is a disservice to yourself and everyone around you.


It all depends on your personal definitions of 'shiny' and 'work' I suppose. Current GNU/Linux phones unfortunately don’t even clear the ‘work’ threshold for me, and are far from it.

If current GNU/Linux phones work for your needs, that’s great - but sorry to say that you are not representative of all users (neither am I - that's the point, kind of - Android/iOS are mature enough to cover most users' needs). I don’t want to go into too much detail of my specific needs, but let’s just say the deficiencies boil down to (a) vastly inferior power management/battery life, (b) vastly inferior processing power in the current crop of hardware and (c) specific apps/services not being available on the platform (and likely impossible to run via Anbox because of (b)).

I would actually love to jump to a GNU/Linux phone. Less so because of freedom or privacy concerns (they are a factor, but not the dominating factor). More because I prefer the traditional desktop/general-purpose-computing OS way of doing things (file-centric vs app-centric, root access to the entire file system, development directly on the device). I would honestly be fairly happy with Android if it was pre-rooted, imposed fewer restrictions on what apps can do, and was based on a mainline kernel ideally.

I have previously used Ubuntu Touch for about a year on a secondary device, I have a Librem 5 on pre-order, and I follow development for the Pinephone somewhat closely and am tempted to get one. But for the foreseeable future I can't see a GNU/Linux smartphone replacing my Android - I'd see it as a complement to it (a tiny portable laptop).


Linux on the desktop is eminently usable, and many people do use it daily to get work done. I have yet to see someone make something usable for mobile.


Maemo


It doesn't work for most people who need to use

* Google services for work / school

* Facebook / Whatsapp / Instagram for keeping in touch with friends.

* Spotify, Netflix etc.. in good resolution

* Many other specific apps.

It's not all black and white either. Traditional linux doesn't sandbox software. Android does sandboxing pretty well.


MMS doesn't work on any FOSS non-Android Linux phone I'm aware of, so they definitely do not work for a significant percentage of the population even for basic group text messages.

Building an alternative phone OS is much harder than building an alternative desktop OS—the requirements are much higher (battery life, cellular, app support) and the mobile web is far less developed as a stopgap compared to the desktop web.

Desktop Linux is usable for most developers and people who don't care about UI consistency or proprietary applications like Office and Creative Cloud. That's a reasonably significant chunk of the computer-using population. The same cannot be said of phones.


MMS? Seriously, that's your bar?

I haven't had it working on Android or iOS for years, only realising when it accidentally tries to send.

I just assumed it didn't work because nobody cared.


No, that's just a technology that I consider "basic"—and one which most Americans use at least a little, even if the experience is terrible. And it does work for most people, even if it compresses images to oblivion and is slow to send messages.

My bar for widespread adoption is far higher, but it may be somewhat unattainable and it's definitely not necessary for the types of people who use desktop Linux. Even if you're happy with desktop Linux—in other words, your expectations of integration and proprietary software support are low—you won't be happy with current Linux phones.


SMS and MMS are much more popular in the US than in the rest of the world in my experience.

They are, to my understanding, the default way of sharing pictures and group messages between iOS and Android there.


On the Linux phone I have (pinephone) with the carrier I have (At&t) there is a script that can pull and send mms messages. There's work to get this integrated into libpurple sms so it you can use it from a shiny GTK3 app just like sms.

I think it would be good to point out that MMS often doesn't even work on android phones. So making that a requirement is a bit silly.


What is a handheld device that can make phone calls that you recommend instead?


There are several Linux phone projects being worked on right now. Not quite ready for the average user, but the PinePhone [1] is more than capable of making calls right now and is very affordable.

[1] https://www.pine64.org/pinephone/


I was miserable with my PinePhone until I found out about https://github.com/dreemurrs-embedded/Pine64-Arch - this is an Arch-based distro that works very well, ime. Previous attempts results in glacial response times, sub-day idle battery drain, broken software updates, and overheating.


Doesn't it run Manjaro by default? (Which is also 'Arch-based'.)


Mine was the UBPorts edition but I believe the latest shipped phone is Manjaro based. I was planning to try that as well at some point but the current version I have makes me happy enough to not want to experiment anymore :) . Edit0: s/release/shipped phone/ .


I've been quite happy with a F(x)Tec Pro¹ running Sailfish OS. It's a full Linux environment, and it's the best hardware keyboard I've used on a phone since the Nokia N900.

https://www.fxtec.com/pro1


Termux has saved one of our projects literally tens of thousands of dollars in SMS fees from someone like Twilio.

We have a few areas where non urgent SMS reminders need to be sent to users. We literally just use a couple of cheap ($100) Android phones with termux on an unlimited message plan with a local provider (who approved us for commercial usage).

The actual process is a glorified bash script that pulls API jobs down with curl and then uses termux-sms to actually send the message.


That sounds like it would be very useful for a personal project, but the docs for termux-sms state "Usage of this API is no longer allowed by Google and we had to disable it to prevent delisting of Termux:API application from the Google Play." - are you building your own version, or are there official builds off Play that include the feature?


We're running builds from FDroid.


How many SMS do you send daily? Do you have a regular plan with the local provider, or some specially negotiated one?


Not totally sure but easily > 1,000. We negotiated but not at a high level.


What a fantastic idea!


I found Termux a while ago, and thought it was interesting. then I found you can run python, ffmpeg and youtube-dl on it, and now I think it's the best thing since sliced bread. I'm still to try to run Jupyter on it, but I think it might be able to.

As all my computers run Linux these days, it also has replaced all my "from-x-to-android" transfer apps.


I am interested in knowing more about your file share set up


scp?


Yes, exactly. BTW, I never said I was sharing files :) just that I replaced the corresponding apps.

Lately I was using Feem, but grew tired of it because it won't allow you to choose the folder when transferring using the free app.


"This version requires Android 7.0 or newer."

Termux is a great piece of software; I'd love if they would keep supporting older OS versions as well, since it's the kind of software one would keep on that old tablet to be used as a terminal or generally as a Swiss army knife.


I'm currently using an Android 6 phone. Fortunately, it is still possible to use Termux on it. Some things are not available (extra repositories) but many things are still here.


I find things like termux most useful with network connectivity, and a device you can't update should never be connected to a network.


I find Termux most useful when I don't have connectivity. Two thirds of what I do in Termux could also be done over SSH, but I like keeping it local.


I beg to differ. Network connectivity in a managed home environment is fine. I use Termux to transfer backups, images, PDFs between my home server and an "old" Nexus7 tablet. And I sometimes use it as an offline map device while hiking, after downloading OSM maps and gpx files with track infos.


Maximum snark: That covers most Android devices, then.


Put LineageOS on it.


A while ago I ran TOR from this while serving a NodeJS chat via HiddenService. Had no issue reaching it from another network. Not sure if it’s still possible, but this app is quite powerful.


what do people use this for?

While I was really excited when i encountered it, I didn't find any practical uses.


On phones, I've installed node & python in it and used those systems as a powerful handheld calculator.

On my tablet, I used it as an ssh client.

On my VR headset, I used it to create a self-contained development environment: https://www.reddit.com/r/cyberDeck/comments/fc5sfr/oculus_qu...

You can use its PRoot functionality to run various Linux distros: https://wiki.termux.com/wiki/PRoot

And you can run Linux GUI apps if they are compiled properly: https://github.com/adi1090x/termux-desktop


Troubleshooting services and bypassing Google's help.

Scenario 1: You're in the middle of your data center. Internal tools/tests say that $service is running correctly, but external customers says it isn't working, and firewall won't let you use an external IP without having to run 3 floors away on the other side of the building.

Solution 1: Open termux, and running telnet aaa.bbb.ccc.ddd $PORT and test

Quicker then waiting for a co-worker to get back to you on Slack.

Scenario 2: You are setting up a new VPN server and want to confirm that your outgoing connections are being routed through the correct IPs/Gateways.

Solution 2: Open termux and run tracert and see where you are being routed.

and many more....... I used to own a Nokia N900. Having a Linux CLI that works in portable device (wifi + cellular) is so damn handy. I use it atleast 2 times a week. It's a perfect diagnosing tool for OOB troubleshooting.


Syncing photos off. Termux has sshd (you have to start it manually once, then it stays running until Termux is killed or the phone is rebooted).

With ssh-copy-id it takes a single command (1-line script) to rsync the phone's DCIM directory to my main machine for further processing. Nothing needs to be done on the phone at all other than to lightly nudge it to wake it up so sshd sees the connection attempt.

Downside: Android security clampdowns mean termux can't see the SD card. So I can only sync down the phone's internal camera directory and that's where I have to store the new pictures and videos. This means space occasionally runs low and I have to move stuff to the SD card. But in the future, they probably won't allow Termux to even work any more in its current form - no "exec" of executables that werent' installed as part of the apk.

Why do all this? Because I'm old school. My phone is an extension of my data ecosystem, which lives on (redundant and backed-up) hard disks in my home computing setup. I don't even let the phone sync the photos to the cloud.

Admittedly I've found no other practical uses for it; all the interesting stuff is blocked by Android security (e.g. back up or otherwise process your call/SMS history).


Alternatives:

Resilio Sync: use it in backup mode to sync photos to your desktop pc/mac/nas. Delete photos from phone when you want to free space. Also lets you access and edit normal files, either on demand or by sync. https://play.google.com/store/apps/details?id=com.resilio.sy...

PhotoSync: sync your photos to pretty much anything. https://www.photosync-app.com/home.html


The thing with these apps is, not your suggestion in particular, is its not ever as it was 20 years ago "use this app it does this", now it is, "use this app it will maybe ask to ship your data to NSA or China, ask for account registering signup, for sure it will make some network calls to who knows where and include adtracking and other nastiness, and will nag about some license or buy-up".

Termux, ssh and rsync. Thats it. It works. I tell my phone, try to rsync when its been charging for at least 5 minutes and its evening time. Hurray.


The other thing is that these apps invariably screw usability up in some way. I use Sweech as a Wifi file server on the phone, but to get pictures off... whoops, no multi select. so if I want to grab the newest 50 photos off the wife's phone, that's 50 checkmarks to click (I'm not geeky enough to have Termux on the wife's phone). Or apps that only talk to a companion app on your (Windows or Mac) computer using a proprietary protocol. Or simply need a crapload of taps to get the job done.

Whereas the rsync method is exactly this: "syncphone" on my main machine. If it doesn't connect, nudge the phone so it wakes up (it'll connect anyway eventually; the phone seems to wake up on its own now and then). And then it's all automatic and scriptable from that point. I realize that perhaps 0.1% of smartphone users have the skills to automate things at that level and therefore care.

The auto rsync when charging is a good idea. I guess Termux can still get access to the battery/charge state?

Another example of user hostility: While on Android phones, at least older ones, bulk transfer of files via USB to/from a Linux machine has always been hit and miss, it's been rock solid on iDevices. Just do "idevicepair" and after that, transfer away to your heart's content, fast and solid. Only now I read that the latest version of IOS may have messed that up too, in the name of security of course.


> Android security clampdowns mean termux can't see the SD card.

Not sure that's what's causing it; I can definitely scp files from my Android phone's SDCard to my servers. But I've not tried initiating the scp from the other machine to my phone.


For what it's worth, my SD card is unencrypted so Android treats it as external storage, rather than encrypted and integrated into Android's "system" storage.

Anyway what's left of filesystem access for Termux isn't really a blacklist as in "you're forbidden to go here" but rather feels like a whitelist. There are a few carefully selected places you're still allowed to go, front and center being the DCIM directory.


If DCIM syncing from external SD card is an issue, I would suggest looking into FolderSync. I've used it personally for music syncing. I'm old school too when it comes to curating my own music library.


Rooting isn't as terrifying as it used to be, and it means you can do actual real backups and genuinely own your data.


One issue is that these days many people work at places that have BYOD (Bring Your Own Device) policy. This means you install work related apps on your own phone rather than being supplied with a work phone like in the old days. Many of these apps refuse to work on a rooted phone "for security" (justified or not, that's the argument)


If dont know mich about these work related apps but all my banking apps work with a magisk based root. So maybe thats a workaround.


I'm pretty sure flashing a non-OEM ROM on my Note 9 would blow an eFuse that permanently marks the thing as having been modified.

Certainly, when I unlocked a Sony Xperia XA2 it did something similar where it won't ever get OEM updates ever again.


This takes some setup, but you can add ffmpeg and python, and from there youtube-dl. There's a url handler so I can download podcasts and other things by using the built in android share function from page links.

People also use it on chromebooks for dev work that doesn't require low level compiling. I have seen NPM and webdev work being done using termux and I have seen people use it for Jupyter Notebooks too.

It also integrates with Tasker (another android automation app).


What setup? I thought it was just `pkg i ffmpeg python && pip install --user youtube-dl`?


The setup I was focusing is creating a meaningful bash like script that runs when the URL is shared to Termux. I have also set up ways certain sites to have their audio stripped from the video, using ffmpeg and while basic, it does take about a couple hours to get things setup bug free in a way that's easy. Easy as in a two click, share -> termux and then just letting it run and it'll finish. And as other have mentioned, getting storage permissions right.


Just a few days ago I thought about using termux-api to do a quick poc for a monitoring application. Namely, I wanted to send an SMS when an event occurred.

Termux-api used to offer this [0], but apparently some time ago google decided to make it impossible:

> Usage of this API is no longer allowed by Google and we had to disable it to prevent delisting of Termux:API application from the Google Play.

It's my device, my SMS plan over a (supposedly) open source system. But it's the vendor's platform, and a huge part of it is proprietary (the play services).

This is the windows monopoly all over again, but in our pockets and with deep analytics backed in.

OK sorry, this ended being a rant. Is there an escape hatch? When will we have a credible free software mobile operating system?

[0] https://wiki.termux.com/wiki/Termux-sms-send


Termux:API is available on F-Droid. Maybe the functionality exists in that version?


I fear not. My termux is installed from f-droid.


It was removed from termux-api in 0.32: https://github.com/termux/termux-api/compare/v0.31...v0.32

Discussed in termux-api issue #257: https://github.com/termux/termux-api/issues/257

Unless you build it yourself with the functionality restored, you can't use it. Termux maintainers are just that dedicated to targeting Google Play first.


You can buy Linux phones right now!


Any thoughts on the best options for those of us wanting one? It seems pretty much to be Pinephone or Librem 5, are there others? Both are preorder only. Anything generally available?


PinePhones have periodic batches, not sure if that's considered a pre-order exactly.

Check out the devices[0] list on the postmarketOS wiki to see which Android phones and other things have support. In general none of them will work as well as the PinePhone, because Pine isn't fighting this sort of thing the way most manufacturers are, but it could be a fun thing to look into if you own anything already supported. You could also port it to a device not yet on the list if you're up for it.

[0] https://wiki.postmarketos.org/wiki/Devices


- routine backups with rsync (one time setup in my shell config with a `bkup` alias and then I just run that when I think of it)

- grabbing albums off my PC with sftp

- easy way to unzip files

- play audio via mpv

- run `xdg-open` on a file and get a native popup to select an app to open it with

- ssh into your other machines, works well to pick up your irc chat away from your pc if you use irssi + tmux (or weechat, or screen, etc.)

- use a "real" editor like vim or emacs locally on your phone

- api stuff, you can control the torch, notifications, etc. you can make scripts around that (imagine a simple `sleep 30m && ...` sort of one liner that turns on your light and plays some audio to wake you from a nap (I haven't done much with this part of termux)


A combination of general use and learning.

General: Using T-UI because I'm not a fan of modern touch UIs, but it is limited to Android functions like messages and launching apps. Anything beyond that (SSH, text editing, web calls, etc) I do through Termux. I wish I could combine the two more seamlessly, but it's effortless to switch between the two.

Learning: Wanted to learn to use vim. Termux provided simple vim access and vimtutor. I've also used Termux to freshen up on languages and write a few scripts. Namely, differences between Python2.7 to Python3 which I didn't look into until this year. Starting on C and/or Rust soon.


Programming on the go. Ruby, Python, Rust, Go, Nim, and many other programming languages are available for it. As are editors like Emacs and Vim.


I don't use it often, but I did use it twice to get a misbehaving apache service restarted while on the bus/train to work, saving me about 20 minutes of downtime before I could get in front of a better keyboard.

There's a widget addon that makes doing those sorts of things one-tap: https://wiki.termux.com/wiki/Termux:Widget

Though naturally once I created a widget to kick apache, it never failed again.


A bash script that scps today's photos to my NAS

Persistent SSH session to a server running Weechat for IRC

(Remember to run 'pkg update' every so often, a recent update to the app required a reinstall or manual fix for anyone like me who didn't know it could be a problem)


I could see it as a rather easy way to get people to try programming with a tablet / keyboard combo. You can install Go, or Python and run a web server and visit it from within the browser... It's pretty impressive and capable honestly. You can find < $100 Android phones that are prepaid these days, I got a few ages ago.


I'm using this almost daily for various open source work. It has my vim setup, tmux, node, and git.

Primary usage is via Samsung DeX so I have multiple windows and a proper mechanical keyboard.


Same, but miss a real browser with devtools so much. Everything's great apart from that. UserLand is ok but the VNC mode messes with a proper environment with alt-tab.


I learnt python and did coding on phone(too broke to buy pc) so I used it for running python projects, using git and deploying the projects on heroku with the CLI.


I use it for emacs, mostly org mode on my phone. It works reasonably well with a small bluetooth keyboard.


> I use it for emacs, mostly org mode on my phone.

I'm not the only weirdo who does this! Although I manage to get by with Hacker's Keyboard.


This was my use case, unfortunately I never figured out how to get my keyboard to accept CapsLock as a Ctrl key. Any suggestions??!


That's actually the "reasonably" part. The BT keyboard mapping is not completely perfect for a few corner cases (I think alt-space was one?). Hackers keyboard is OK for small tasks. You might try a small USB keyboard and USB OTG cable if your phone supports USB peripherals. I used the setup more when I was going someplace and didn't want to drag a laptop. Since I'm not going much of anywhere these days it's of much less use, in fact last time my check termux busted on some update but I haven't needed it so I haven't fixed it.


I rarely use it for more than ssh into work servers on the weekend, downloading videos, or testing code snippets. But it's really nice to be able to use normal iperf rather than looking for some Android application that wraps it and may or may not contain ads.


This. Termux is a great AIO app for a lot of apps available on the Play Store. I use it for running kubectl, ssh, scp, rclone, rsync, etc.. if there is a ARM binary it will most likely run in Termux.


You can run it on a FireTV stick by downloading termux via the F-Droid repository. Connect a bluetooth keyboard and you have a nice little linux environment to play around with. I installed archlinux on it and use it to test packages for ARM.


I've used it for ssh-ing into my various machines, both work and personal. I also did some development work using this when I was stuck without a laptop. And one time it was useful in sending out a mass text.


- Stand up an ad-hoc web server with `python -m http.server 8000` and use it fetch some photos onto the desktop over local wifi.

- Having a backup of my private repos and dot files that's always with me. Easily keep them up to date with a pull every now and then.

- Occasionally do some lightweight symbolic math or high precision arithmetic with Emacs' calc.

- Test the portability of a library I've been writing by building and running its test suite on a lower-powered ARM environment.


Routing a development server to the phone's localhost so I can use https-only features like service workers and camera access without setting up https.

ssh -L 8080:172.383.20.18:8080


Primary: File management. I tend to prefer the command line for that kind of thing. Includes occasionally rsync-ing or scp-ing stuff to and from servers, and modding a few games I have on Android (Beamdog's Enhanced Edition mobile ports of old CRPGs).

Secondary: Study programming - I am a self-taught programmer, and before the pandemic I would study a lot on public transit, in coffee shops, while waiting for people etc. This actually used to be the primary use case before I started working as a professional programmer and was also using breaks to study. Android/Termux is not really suitable for actual dev work (e.g. you'll probably need Docker at some point if you're doing backend, and you'll want a browser with dev tools for frontend), but for limited study projects (especially backend dev) it's absolutely awesome.

It's also my SSH client to access a few servers I keep privately, but this is a feature that certain dedicated apps (e.g. JuiceSSH) could do equally well or better, and I'm just using Termux because I already have it.


- ssh (with a proper openssh config and various convenience wrappers around it)

- a local bookmark manager and search redirector that i wrote in Go (much easier to just run in termux than turning it into an Android app)

- sshd to allow adhoc file transfer and command execution over ssh, getting various information from the phone using the termux cli APIs

- random shell stuff although i tend to do most of that over the ssh connection.


ssh into a secured machine with port forwarding, then being able to access services exposed from that machine e.g. for web testing on Android, or using VNC / NoMachine to remote into it.


I run sshd on termux, and mount it wirelessly on my laptop via the phone's hotspot with sshfs on the laptop.

https://news.ycombinator.com/item?id=20660301

So I can copy photos from phone to laptop and post process with a script.


For me, it's either to youtube-dl music onto my phone (mostly stuff from CDs I had bought but were stolen or lost), or run a small Python script to cheat at word games (finds all combinations of letters in a dictionary file).

Things that don't rise to the level of deserving an app, but are nice to have.


If there is a ARM64 binary, it will most likely run in Termux. I use it with helm, kubectl, rclone, ssh just to name a few.

ssh is the most used for me because I don't want to use Termius (paid) or some other SSH wrapper app. Termux is free, allows you to easily create ssh keys and use ssh-copy-id.


See if JuiceSSH fits the bill for you. I use it and love it.


I have... JuiceSSH is ssh wrapper, riddled with bugs, isn’t free and it’s abandoned. Termux is honestly the best ssh client because it’s so much more. The only place it falls short is syncing between devices.


> what do people use this for?

Emacs, org-mode, git and ssh. That's pretty much it, but allows me to have access to my org-mode files anywhere, just like on desktop.

But I'm also one of those weirdos who runs his own email server and sshes in to read mail in mutt.


rsync over SSH for backups. Google photos want including the highest quality images, and I had tremendous terrible with both this and my last phone copying off large files (long recorded videos at high res) locally via normal USB methods.

A script running rsync over SSH over wi-fi works every time. And as I use rsync for backups generally (have done for many years) this integrates nicely with my general way of doing things.

I've not tried running SSHd to allow things to be pulled off or pushed to devices, but others report that working well too.


I've found it useful to occasionally ssh into my raspberry pi. But I don't think I could use it as a serious work tool unless I had a Bluetooth keyboard connected to my phone.


tmux + Termux + brow.sh allows me to do browsing, email, maps, even shopping online in the middle of nowhere with a few bars of 2g connectivity.


A colleague used it to run iperf3 to test his home wifi.


If Android had a real browser with devtools (Firefox or Chrom*), with Termux and a command line editor like vim, Web developpement would be completely doable with Samsung Dex or a tablet.


I played with termux a bunch. I found it to be lacking when not rooted though. If i remember right it also lacks a lot of access to most of the android api, making any kind of serious development not really practical.

The one i really miss though is SL4A.

https://en.m.wikipedia.org/wiki/Scripting_Layer_for_Android

It's a shame it ended up being killed off. I wrote a bunch of lua scripts with it. Including a small app to fetch bus schedules from a current stop. I could add scripts to my launcher and run them the same as a native app.


I run Jupyter Notebook python etc and create termux simple apps you even with a small web gui visible through my phone's browser.

But due to the restrictions that were placed on Android a few years back I lost the capability to make system apps in python.

I had a cleanup, backup, and could make custom interfaces enhance other applications using their sqlite data.

I guess now I am protected, from me.


Don't you feel much safer now?


termux-url-opener has been an excellent tool to easily make use of Android's share menu. Taking inspiration from "YouTube-DL the easy way on Android" [1], I made a script that adds a URL to my bookmarks server [2]. It'd be even better to write a script that has some rules or a prompt so that different URLs can be handled differently (e.g. video URLs prompt for download, or there could be a prompt to add the page to archive.org).

[1] https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_th...

[2] https://github.com/zvakanaka/termux-bookmark#readme


Here's my termux-url-opener:

$ cat ~/bin/termux-url-opener #!/data/data/com.termux/files/usr/bin/env bash

read -ep "[c]ast or [d]ownload: " -i "c" choice case "${choice}" in c|C) catt cast "${1}" ;; d|D) pip install --upgrade youtube-dl cd ~/storage/movies youtube-dl "${1}" ;; *) echo "Sorry, that's invalid." exit 65 ;; esac


see also: iSH for iOS (https://ish.app/)


The key caveat being that iSH does x86 emulation to achieve this, but otherwise it seems to looks pretty darn nice. I have yet to try it but now that I've switched over to iOS I may just download it to compare usage vs Termux.


Quick question as I'm giving this a spin (thanks!!). How do I go about installing an ssh client? Or is that only available in the testflight version?


SSH works, see their wiki[1] for installing apk. After that run apk add openssh.

1. https://github.com/ish-app/ish/wiki/Installing-apk


It is great but slow and 32bit.


It’s not that slow...


It is. The design, somehow dictated by Apple constraints, makes it so.

I find it usable as a text editor, git client and ssh client, which is great really. Any lightweight CLI usage should feel great.

I was hoping to run go and python code locally, but even installing deps, not to mention running tests is unreliably slow.


No dynamic code generation for apps on the App Store :(


It’s pretty slow; usually somewhere between 10 and 100 times slower for most language runtimes. On newer devices this is less of a big deal, but only because they are ridiculously fast.


It took 2-3 minutes to generate a SSH key... I would consider that slow. I still use it almost every day though, I was able to get kubectl to work!


iSH is great, I have it on my iPad (my phone is a Pixel with Termux), but performance is atrocious due to the emulation.

Maybe it's better on the most recent Apple SoCs, but on my iPad mini just opening a small text file in vim takes a second or two (instant on Termux/any other CLI I've used in the last decade.

Rsync is so slow as to be useless - I think because it takes forever to calculate the diff.


Termux, Termux-api, there is a termux job scheduler thing. Also rsync and openssh on it.

Then you copy the ssh public key from the phone to your "home-server", and setup a job scheduler to run rsync - now you have better than nextcloud syncing of your phones pictures/what-have-you with your home-server.


But what's the battery usage? And handling meshing? why not just use Syncthing?


Battery usage is basically zero, since I schedule it to run during evenings and night-time when it is charging with the termux-scheduler-thingie. Android wakes the script up, when those conditions are met, no battery waste. The script when waken up - it checks if the file left over from last time is older than 1h, if so continues to sync, otherwise exits.

Setup of a ssh connection is similar to https, rsync exchange of rsync is usually "all good" and thats it. Rsync otherwise is a very efficient but not very documented protocol network-bandwidth-usage-wise.

Mesh? Syncthing, tried it, sucked for reasons I cant remember now. Nextcloud - had it for years, mind you I was contributed to nextcloud the android app, fixing many bugs, but still it caused me data loss / picture loss. Which I only found out after implementing the rsync solution and seeing OMG rsync found so many pictures Nextcloud was supposed to keep in sync for the past year but it just bugged over.


Twice now I've had, for reasons I can't explain, a folder on my Mac somehow gets renamed from "backgrounds" to "Backgrounds", and then syncthing complains it can't sync the folder for a day or two because the folder is still "backgrounds" on the other clients(which I usually don't notice until I go back digging through the logs), and then somehow syncthing deletes all of the files in this folder on all of the machines, and then spits out a steady stream of errors complaining it can't sync files because no machines currently online have these missing files that it just murdered.


One thing to note is that the directory hierarchy in Termux is not the same as a standard Linux. For example, in termux everything is under `/data/data/com.termux/files` and there is no `/tmp`. Use PRoot in termux to install a standard Linux distribution.


Does someone know if it is possible to use it on a FireTV Stick (without root)?



You don't need to root the FireTV stick at all. You can install termux from the F-Droid application by installing F-Droid first by installing the APK from the Downloader app.

If you want to root the device for fun, I wrote a little tutorial post a few months ago https://miguelmota.com/blog/rooting-a-fire-tv-stick-4k/


You might want to check out adbLink[1]. It makes managing firesticks pretty simple.

1: http://jocala.com/


It's much more convenient to use a native terminal on a GNU/Linux phone. Everything you would do on a desktop, you can do with it.


Out of curiosity, what GNU/Linux phone would you recommend?

Most of the ones I have read about are still fairly alpha-level products, particularly for the phone software and app ecosystem.

I would love to have a fully-functional phone running GNU/Linux that I can use as a phone and carry around in my pocket and then plug in a keyboard, mouse, and monitor and have a "good enough" computer for basic office and programming capabilities.


I'd like to note that Termux is totally amazeballs on a Cosmo Communicator: https://www.www3.planetcom.co.uk/cosmo-communicator

Having a proper fold-out QWERTY hardware keyboard makes for an eccentric Android experience, but Termux (or, alternatively, their dual-boot Linux solution) makes a huge difference.


Shame about the keyboard problems, though. They rushed it out before fixing them when the Gemini had them.

A common issue is that alt-tab activates caps lock because alt is adjacent to fn, and fn-tab is caps lock. I'm not an engineer, but I assume it's poorly designed.

I have the Gemini PDA and will never give that company my money again.


I have the Gemini PDA and love it. (I don't use it as my 'phone though, even though it has cellular). I've ordered the AstroSlide and will be using that as my 'phone when it arrives.


I have seen some happy & successful users of the PinePhone[1] on my social network feeds. The price is great, capabilities are all there & supported, the community has been doing a good job scratching-their-own-itches & furthering support. The only thing that's held me back from fully adopting it is that the main camera is 5MP, and I have been feeling a little short with even the 12MP camera on my Samsung S series daily driver.

[1] https://www.pine64.org/pinephone/


I recommend Librem 5: https://puri.sm/products/librem-5. The company develops both hardware and software respecting the users.

Upd: Video showing Librem 5 used as desktop: https://puri.sm/posts/a-librem-5-video-made-on-a-librem-5/


I want one, but it says it doesn't ship for 6 months.

I think it's important to stick to things that exist today. The Librem 5 is cool, but it's still vaporware. Hopefully that changes.


It technically should start shipping in November, but the preorder queue is so long that new orders have to wait for about 6 months.


Thank you for the recommendation.

I will definitely put it on my list of possible candidates for my next phone.


Does anyone have experience running Android apps in Anbox on this phone or the PinePhone?



Cool, thanks for the resources. I'm also looking for anecdotes from users, because the last time I tried Anbox on Linux, I couldn't run much, and I'm wondering if it's any better now.



> I would love to have a fully-functional phone running GNU/Linux that I can use as a phone and carry around in my pocket and then plug in a keyboard, mouse, and monitor and have a "good enough" computer for basic office and programming capabilities.

As much as I like the idea of 100% FOSS in my pocket, it's simply not practical because I need to use Android apps to hail rides and contact friends who often use only closed-source messenger apps.

If you're in the same boat, a very realistic alternative would be to just carry around a Raspberry Pi.


>> it's simply not practical because I need to use Android apps to hail rides and contact friends who often use only closed-source messenger apps.

That is currently where I am as well.

Termux has been a wonderful way to get simple programming tasks done on the go because I can just plug in an external keyboard, mouse, and monitor and have a command line, text editors, compilers, etc.

I am concerned about how Android 10's limitations will impact Termux since I would hate to lose such a useful tool.

Seeing what GNU/Linux phones are out there at least provides some other options about where I might want to go next once my current phone ages out.


On the other hand, every other non-terminal task would be far less convenient. And maybe even impossible, given that some tasks require apps that are only available on Android or iOS.


While this is strictly true, 1. it's reduced by Android compat via anbox, 2. some version of that is always true; Android users don't get iOS-exclusive apps, iPhone users don't get Android exclusives, and neither of them can get some desktop apps (although Android can do VNC with termux or a chroot to get very very close, and iOS does have iSH, bringing us back to "if the compatibility layer is good enough..."). The question is whether the apps that each users wants are sufficiently available on the platform of their choice. And true, sometimes the answer is no; just as some people are stuck on NT because WINE doesn't work and they need a Windows app, so some people will be stuck on Android/iOS, but by the same token some of us are doing just fine on FOSS platforms.


It's not a necessity that non-terminal tasks are less convenient. It depends on the GUI and definitely can be done well. For Android-only apps, there is anbox.


But with a significantly reduced phone experience.

I see the benefit, but the phone isn’t anywhere near the quality of a high end android or iOS device in terms of hardware or general app availability.

Termux is clearly provide the opposite to what you’re suggesting - having a terminal available without sacrificing everything else.


> in terms of hardware

https://source.puri.sm/Librem5/community-wiki/-/wikis/Freque...

Librem 5 has a number of features generally only found in high-end phones, such as USB 3, dual-role port, DisplayPort alt-mode, high resolution video out and a discrete audio DAC, but its CPU performance and its video processing capability are those of a low-spec phone from several years ago. For people who want to buy a phone that supports convergence or a specialized security/privacy phone, the price of the Librem 5 is very competitive with the other options on the market.

> general app availability

https://source.puri.sm/Librem5/community-wiki/-/wikis/Freque...

There is are a huge number of existing desktop Linux applications that can be adapted [not rewritten!] to run inside Phosh.


Literally from your own quote...

>its CPU performance and its video processing capability are those of a low-spec phone from several years ago

That's enough for me to decide the experience isn't on par with a flagship Android or iPhone - but that's not what it's trying to be.

This isn't trying to be a phone - it's trying to be a mobile linux PC that you can also use as a phone and has the same form factor.


Yes, this is all true. I did not try to say you were wrong. But I'm curious, what are you going to do with it? Why do you need the high-end performance?

(It can even run 3D games: https://www.youtube.com/watch?v=S_HXQJkWjUQ)


Apologies - didn't mean to seem argumentative.

Having a high end CPU isn't just for performance right now, my main concern would be longevity of the device.


> This isn't trying to be a phone - it's trying to be a mobile linux PC that you can also use as a phone and has the same form factor.

You literally just described an Android phone to someone from 2006.


Except Android never became what we expected from it. It restricts what you can do with it.


Agreed. I think to a fairly tech literate person from the early 2000's it would look like an awesome Windows/Linux hybrid. To a sys admin from that time, it would look like a nasty, restrictive ball of crazy. I'm personally really interested in the librem phones because Id love to carry a fully functional Linux box in my pocket, something I could write shell scripts for and run them from simple GUIs.


Agreed in principle.

Do you know any on-screen keyboard for mobile Linux that is as good as (or at least approached) Hacker's Keyboard on Android?

I have a Librem 5 on pre-order, and am following PureOS and PinePhone related development somewhat, but so far I have not seen an on-screen keyboard that gives you all the modifier/control keys (+ chording of keys) and arrow keys...without those, the CLI really is not very useful unless you're always going to use an external keyboard (doesn't make sense to me, it's no longer portable then) :-/


Yup, use it to run jupyter notebooks.


top has been busted for ages




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

Search: