I’ve probably reinstalled Termux twice on each Android device and then had to fiddle a bit to get it customized. Now I tried to update my phone and the repositories have changed since the last time I upgraded and the termux site says to no longer use the Google Play version.
It’s time to have a single place that describes the full install.
Make sure there is no version of Termux installed, perhaps from Google Play.
F-Droid is an app store for various open source software. Install it from here:
then install Termux:
There will be a lot of prompts to allow installation of these apps on your phone.
Run termux then:
pkg upgrade
It updated a number of configuration files and I hit “Y” to accept the new version.
Install git:
pkg install git
We will be running a variation of the commands here:
https://github.com/sizezero/dotfiles
Note the location of the git executable on the filesystem is different so the second command is slightly different.
git clone --bare https://github.com/sizezero/dotfiles.git ~/.cfg
alias config='/data/data/com.termux/files/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config checkout
#if the above command fails, delete or backup any conflicting files and retry
config config --local status.showUntrackedFiles no
Pulling from github is fine but if you want to push you will need to setup ssh access.
pkg install openssh
Only follow the first few instructions from:
https://github.com/sizezero/dev-notes/blob/master/using-ssh-for-github.org
These are duplicated here:
$ ssh-keygen -t ed25519 -C "robert@kleemann.org"
Be sure to type a passphrase that isn’t too cumbersome. You will have to type this every time you push since termux doesn’t have a good, permanent ssh agent.
This created:
~/.ssh/
id_ed25519
id_ed25519.pub
Install the Termux API app via F-Droid.
Then install the termux-api from within Termux:
pkg install termux-api
termux-clipboard-set "hello world"
Paste the “hello world” text into some android app to verify it is working.
Copy the public key to the clipboard:
termux-clipboard-set < ~/.ssh/id_ed25519.pub
On your phone, navigate to the github settings page. Go to the section on ssh keys. I named mine “phone termux”. Paste in the key from the clipboard.
I’m not sure if I should keep this list up-to-date or just update it every time.
pkg install emacs
Navigate to the end of the file ~/.termux/termux.properties
and
uncomment the line:
ctrl-space-workaround = true
Then run:
termux-reload-settings
There are ways to backup and restore termux that I may want to do to prevent me from having to set this up again. On the other hand, termux seems pretty flakey and I think it’s likely that they change their universe in a year or so making backups worthless. All my data will be in committed and pushed github repos anyway.