I am using a rooted Samsung S8+. But, Termux cannot gain root access. I tried su
, sudo
unsuccessfully.
When I tried installing termux-sudo, I had the error cat: sudo: no such a file or directory
.
(Tap to enlarge)
First, install the needed packages.
pkg install proot proot-distro tsu fakeroot parted
Then, go to a new screen in the terminal and type
proot -0 login
Are you sure that's the correct order of those commands? I have a strong feeling that it should have been sudo cat
instead of cat sudo
.
First, you probably need to use su rather than sudo. Where did you copy the sudo from? It looks like some incompatible executable, maybe copied from an x64 distro (guessing).
Second, Termux overrides $PATH. You will need to provide full path or to make su available on $PATH. You might want a symlink (ln -s) of su (which might be located in /sbin/, /system/xbin or so).
You have installed incompatible software. In your output, the line "Exec: exec format error" is the program loader complaining about an incompatible binary format.
Your experiment failed because of wrong software type.
which su
?