Ever thought to use Arch Linux on Termux? Today, I’ll tell you how to install Arch Linux on Termux (CLI Only) without Root.
The script we will use in this blog is made by SDRausty in the TermuxArch organisation.
So, Let’s start
- First of all, install Termux from F-Droid
- Now, open Termux and update and install dependencies to run the installation script:
pkg update -y; pkg install git wget curl bsdtar -y
- Next, Run this command to install on Arch:
curl -OL https://TermuxArch.github.io/TermuxArch/setupTermuxArch && bash setupTermuxArch
. The installation will be started. - Now, if you see the “Operation not permitted” or “Recieved signal 2”, just run
bash setupTermuxArch
again and the installation will be continued. - Also, if you are on Android 12, you might get a signal 9 error, this is due to phantom processes killing. You can connect to your phone using ADB and then run this command to fix this error:
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent; /system/bin/device_config put activity_manager max_phantom_processes 2147483647"
(from #2366).
After doing this, runbash setupTermuxArch
again to continue the installation.
And now, Arch on Termux has been installed! By default, there will be only root account and as the default user. If you want to create a non-root account, follow these steps:
- In arch, run
addauser username
to create a sudo user with a home directory. - Now, to always login to the non root user account by default, we will create our own shortcut. Run this command to make the shortcut in Termux (not arch):
echo startarch login username > archlinux; chmod +x archlinux
Next, to login, run./archlinux
. You will be in the non root account!
Now you can use Arch like normally you use. You can install AUR helpers likeparu
,yay
, etc and do much more.
Try upgrading your system and installing some packages:sudo pacman -Syu; sudo pacman -S git wget nano curl -y
You can read more things about TermuxArch in their docs: HERE and HERE
Note: You cannot use systemd
as basically we are in a chroot environment.
Thanks for reading :) You can tell your queries/feedback in the comments section below. Bye 👋