I am running a lower Android version and need to install a Linux proot container in Android. Another Term is the closest alternative, but how do I install it? It seems pretty hard.
You can run the stock
install-linuxcontainers.sh you downloaded from the Git repo without tweaks for an automatic install. It gave me errors, that's why I did this Q&A style question to write the tutorial on how I got it to run on my old tablet.
Download Another Term from Play Store. If the Play Store version does not work, then go here and try previous versions that work on your device and issue the bug.
Know yor phone architecture
Download run-tpl (after downloading, make sure it has no extension), installshellscript (the file must be like
install-linuxcontainers.sh), proot-android.tar.gz (download both if your architecture has 2 gunzips), and minitar.
As for the
rootfs.tar.xz, google search
and enter. Upon entering, select Distro, then release.
For architectures, if your phone architecture is arm7-a, select "armhf", and if arm8-a, select "arm64". The same applies to i386 and amd64.
Then select default, then choose any build date you want, and then select
rootfs.tar.xz, then the file will start downloading.
After downloading all the files, download Simple HTTP Server app from the Play Store or any webserver app to host the files.
Copy or move
Open the app and start the server. Launch your browser and go to your IP address and port specified in the app. On Chrome or whatever browser, long press to copy the download link address (if using a desktop right click) then go and edit the
install-linuxcontainers.sh using a text editor and replace all URLs beginning which are like this
http://192.168.43.239:8080 and replace them with corresponding download URLs which you copy from your browser. If your ip local ip is 0.0.0.0 then the url should look like
http://0.0.0.0:8080 .Make sure that all URLs have been replaced by your own URLs you copied from the browser and save the script.
Install and open Another Term and click the + icon on top, name the shell profile and save (I did not edit anything).
Stop the webserver in the app
Start on the profile to start the terminal. Maybe you will notice too small or too big font, but you will change the font settings later. Tap on the keyboard icon (top-right leftmost icon) to switch to your default keyboard.
u0_a176@goyave3g:/data/data/green_green_avk.anotherterm.oldgood $ cd /storage/emulated/0/Download u0_a176@goyave3g:/storage/emulated/0/Download $ ./install-linuxcontainers.sh Debian Buster Installation subdir name proots/___ [linuxcontainers-Debian-Buster]: Actual name: kgktk To uninstall: run `rm -rf "$DATA_DIR/proots/kgktk"' Creating favorites... Done. Arch: armv7a Variant: -pre5 Root FS: Debian Buster Source: http://192.168.43.239:8080/rootfs.tar.xz Getting minitar... failed to connect to /192.168.43.239 (port 8080): connect failed: ECONNREFUSED (Connection refused)
Type your fake random directory name and enter.
Profile pop-ups will appear, but quit both and tap OK and Exit and you will return to the shell.
As you can see above, the variant shows "-pre5". If it's not, you are good to go. But if it's "-pre5", you must start the webserver, go to the browser, copy the download link of
prootpre5.tar.gz, go and edit install shell script replacing the
proot.tar.gz link with the new pre5 one, then save the script.
Don't stop the webserver.
The second Run:
u0_a176@goyave3g:/data/data/green_green_avk.anotherterm.oldgood $ cd /storage/emulated/0/Download u0_a176@goyave3g:/storage/emulated/0/Download $ ./install-linuxcontainers.sh Debian Buster Installation subdir name proots/___ [linuxcontainers-Debian-Buster]: Buster Actual name: Buster To uninstall: run `rm -rf "$DATA_DIR/proots/Buster"' Creating favorites... Done. Arch: armv7a Variant: -pre5 Root FS: Debian Buster Source: http://192.168.43.239:8080/rootfs.tar.xz Getting minitar... Getting PRoot... Getting Linux root FS... /etc/passwd: ======= root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin _apt:x:100:65534::/nonexistent:/usr/sbin/nologin systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin messagebus:x:104:105::/nonexistent:/usr/sbin/nologin ======= Regular user name [my_acct]: my_acct Preferred shell [/bin/bash]: /bin/bash Setting up run script... Configuring... Done! u0_a176@goyave3g:/storage/emulated/0/Download $
Now we are going for the last time. Start the
./install-linuxcontainers.sh, type your distro and release as shown above.
Now, type the real subdirectory name of your pr choice. In my case, I chose to type Buster. This time, save & exit the two pop-up profiles. After saving, you will come back to the terminal and notice rootfs downloading progress. After that, you will be asked to type user and shell preferred, type the ones inside the  brackets and enter, and you will notice it done.
Quit this shell by tapping back then long-pressing on it, and click terminate then confirm the termination. Tap on any of the shell profiles you save before name; Buster and Buster (Root) in my case and welcome to Debian, I mean your chosen distro.
By the way, I am in no way part of this project, but I'm just a Linux newbie who has found an amazing project he was searching for for quite a long time.
Shoutout to the devs for this amazing app.
Useful Screen shots:
For new android versions the script has been updated and no need to use the edited script and method except maybe if you want to have a backup of the files needed wenr you want a clean container. For "very old android versions" (e.g 4.4.4 range and maybe 5.0.0) you cam use this script because there is an error in old versions.
You can also choose a bit simpler way...
A ready-to-use statically linked
wgetfor Android: https://github.com/pelya/wget-android/tree/master/android
Up-to-date SSL CA root certs (most usual place on Linux:
You can easily recreate hashes in your own crafted certs directory by means of
openssl rehash <dir>.
Create a "local" profile with the "execute" field left set by default and launch it.
$TERMSH pick .to put the aforementioned
wgetby an Android file picker into the
$DATA_DIR/certsdirectory and put your up-to-date certs into it.
Fix your favorite installation script by replacing all the
$TERMSH cat / copy / etcHTTPS stuff with appropriate
wget --ca-directory="$DATA_DIR/certs" ...
I will create a ready-to-use script a bit later...