Skip to content

Instantly share code, notes, and snippets.

@GabrielMMelo
Created January 22, 2019 12:33
Show Gist options
  • Select an option

  • Save GabrielMMelo/0e146f32d73978bf0d0a06786bcbc96c to your computer and use it in GitHub Desktop.

Select an option

Save GabrielMMelo/0e146f32d73978bf0d0a06786bcbc96c to your computer and use it in GitHub Desktop.
Install sudo in Termux (Android)
apt install git
git clone https://gitlab.com/st42/termux-sudo
cd termux-sudo
cat sudo > /data/data/com.termux/files/usr/bin/sudo
chmod 700 /data/data/com.termux/files/usr/bin/sudo
@cruzheer

cruzheer commented Sep 8, 2023

Copy link
Copy Markdown

But if you need sudo. This code can use at linux. You know, we can install distro linux in termux. You can select CLI only or with Desktop. If use Desktop, at android can use VNC (TigerVNC or TightVNC), if use kalifs / nethunter cli via Kex. This can , without root device.

But need more storage, if you install linux with desktop. Like kali linux if you install Kali ARM64 Full (1.9 GB) after installing is 11 GB. But defferent if cli only full or minimal or nano.

Sorry my bad english.

@cruzheer

cruzheer commented Sep 8, 2023

Copy link
Copy Markdown

For distro linux cli you can search at github or use Andronix app from play store.

For alternative, linux can run without termux use app Linux Deploy or UserLand. You can install from google play store.

This is 2023 please be smart like as your phone. Your phone is smart phone right.

sorry just kidding

ghost commented Sep 12, 2023

Copy link
Copy Markdown

how to fix

su executable not found
sudo requires su

#_________________________

uninstall tsu package

pkg remove tsu

reinstall tsu package again

pkg install tsu

it working.✓ (tested on android 13)

@Drjacky

Drjacky commented Nov 5, 2023

Copy link
Copy Markdown

@omb7141980

All you need to do after script for termux-sudo is make sure your in /data/data/com.termux/files/home/termux-sudo then "chmod +x sudo" then sudo is executable.

Screenshot 2023-11-05 at 10 26 06

@marioestima

Copy link
Copy Markdown

Nothing happen

@cruzheer

Copy link
Copy Markdown

Nothing happen

read my comment, read text at screenshot

@babijavid

Copy link
Copy Markdown

image I tried all steps above on termux , installed tsu , No luck still same issue

@Nikhil-sys-gli

Copy link
Copy Markdown

Screenshot_20210225-023311

Balance commands

@Tyuol

Tyuol commented Jan 17, 2024

Copy link
Copy Markdown

mano
vejam ja internet como fazer root e o modelo do seu celular

@sukua77

sukua77 commented Jan 31, 2024

Copy link
Copy Markdown

~/termux-sudo $ su
No su program found on this device. Termux
does not supply tools for rooting, see e.g.
http://www.androidcentral.com/root for
information about rooting Android.
What ro do now

@DreamDevin

Copy link
Copy Markdown

pkg install sudo

how to fix

su executable not found sudo requires su

#_________________________

uninstall tsu package

pkg remove tsu

reinstall tsu package again

pkg install tsu

it working.✓ (tested on android 13)

Thanks it worked 😀😀

@DreamDevin

Copy link
Copy Markdown

pkg remove tsu
And
pkg install tsu
Then
sudo
It
Worked

@0Xkasr

0Xkasr commented Apr 19, 2024

Copy link
Copy Markdown

Update termux: apt-get update && apt-get upgrade -y
Install wget: apt-get install wget -y
Install proot: apt-get install proot -y
Install git: apt-get install git -y
Go to HOME folder: cd ~
Download script: git clone https://github.com/MFDGaming/ubuntu-in-termux.git
Go to script folder: cd ubuntu-in-termux
Give execution permission: chmod +x ubuntu.sh
Run the script: ./ubuntu.sh -y
Now just start ubuntu: ./startubuntu.sh

Apt update
Apt upgrade
Apt install sudo

@DEAD1nsane

DEAD1nsane commented May 8, 2024

Copy link
Copy Markdown

Update termux: apt-get update && apt-get upgrade -y Install wget: apt-get install wget -y Install proot: apt-get install proot -y Install git: apt-get install git -y Go to HOME folder: cd ~ Download script: git clone https://github.com/MFDGaming/ubuntu-in-termux.git Go to script folder: cd ubuntu-in-termux Give execution permission: chmod +x ubuntu.sh Run the script: ./ubuntu.sh -y Now just start ubuntu: ./startubuntu.sh

Apt update Apt upgrade Apt install sudo

hey!! this worked for me!!!

and now it's not

@VesperQuartz

Copy link
Copy Markdown

I added this and it fixed my issue
elif [ -x $(which su) ]; then SU=$(which su)

@ishitasingh678

Copy link
Copy Markdown

Uploading Screenshot_2025-07-19-20-38-05-85_84d3000e3f4017145260f7618db1d683.jpg…

@ishitasingh678

Copy link
Copy Markdown

su executable not found
sudo requires su

Pls help

@ishitasingh678

Copy link
Copy Markdown

su executable not found
sudo requires su

Pls help I did above all but still occurring this error

@armm29393

Copy link
Copy Markdown

pkg install sudo
It's worked!

@Luna1234julie

Copy link
Copy Markdown

Stiller on kt on m'y zfold 4 not rooted
Please help

@ilyaigpetrov

ilyaigpetrov commented Oct 10, 2025

Copy link
Copy Markdown

If you just need to execute sudo apt [...] then:

alias if-termux='[[ ! -z $TERMUX_VERSION]]' # If the var is not empty.
# Define `sudo` as no-op if inside Termux:
if-termux && alias sudo=''
# Update information about packages:
sudo apt update
# Upgrade all installed packages to the latest versions:
sudo apt upgrade
# Install Python programming language interpreter, version 3:
sudo apt install python3

@ahma78

ahma78 commented Nov 22, 2025

Copy link
Copy Markdown

Mihkhh

@ahma78

ahma78 commented Nov 22, 2025

Copy link
Copy Markdown

Oouu

@Legoscratch

Copy link
Copy Markdown

Does anybody know if this has been patched in Android 16 as I've tried basically everything in this thread but it says:

Termux does not supply tools for rooting

and I don't really know much about termux to be honest but has anyone found any new solutions?

Any help would be appreciated, (also I got it to work on my old phone but it was Android 14, which is why I think it might be an issue with Android 16)

@ilyaigpetrov

Copy link
Copy Markdown

@Legoscratch, maybe you can use https://wiki.termux.com/wiki/PRoot or the official Virtual Terminal app shipped by Google with the recent versions of Android 16 since 2025.

@Legoscratch

Copy link
Copy Markdown

@ilyaigpetrov Sorry for getting back so late, but thanks so much! This is great and works excellently on my Pixel, even has the ability to run GUI applications!!

@LeonGinger

Copy link
Copy Markdown

now this way is not work in Android15,my phone is install magisk-modules ,root and unlock bl,Android14/15, end if you can use "su" command,in temrmux you just need
cat > $PREFIX/bin/sudo << 'EOF' #!/system/bin/sh su -c "$@" EOF

chmod 755 $PREFIX/bin/sudo

and test
sudo id

.../ $ sudo id uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0

@demo77demo

Copy link
Copy Markdown

pip install su

;-)

@StitcyYT

Copy link
Copy Markdown

Can somebody help with this?
~ $ sudo su
No superuser binary detected.
Are you rooted?
~ $

@Indser

Indser commented Jun 10, 2026

Copy link
Copy Markdown

Can somebody help with this? ~ $ sudo su No superuser binary detected. Are you rooted? ~ $
Do you have rooted phone or no rooted
Su means super user so u need to root to use sudo su if ur using Android termux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment