Termux just destroyed it selfe while I was on the go and left me in a pretty ugly situatuin (luckily I had also a tablet with me)
Steps to reproduce
See this transcript
''''""""
``
cd claws_decrypt/
$ make
The program 'make' is not installed. Install it by executing:
pkg install make
$ a
No command 'a' found, did you mean:
Command 'ab' from package 'apache2'
Command 'ar' from package 'binutils'
Command 'as' from package 'binutils'
Command 'ar' from package 'busybox'
Command '[' from package 'coreutils'
Command 'k' from package 'kona'
Command 'ag' from package 'silversearcher-ag'
Command 'am' from package 'termux-am'
$ pkg install make
Ign:1 https://dl.bintray.com/termux/termux-packages-24 stable InRelease
Ign:2 https://dl.bintray.com/grimler/game-packages-24 games InRelease
Ign:3 https://dl.bintray.com/grimler/science-packages-24 science InRelease
Get:4 https://dl.bintray.com/termux/termux-packages-24 stable Release [6061 B]
Get:5 https://dl.bintray.com/grimler/game-packages-24 games Release [5344 B]
Get:6 https://dl.bintray.com/grimler/science-packages-24 science Release [5348 B]
Get:7 https://dl.bintray.com/termux/termux-packages-24 stable Release.gpg [821 B]
Get:8 https://dl.bintray.com/grimler/game-packages-24 games Release.gpg [475 B]
Get:9 https://dl.bintray.com/grimler/science-packages-24 science Release.gpg [475 B]
Get:10 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 Packages [176 kB]
Get:11 https://dl.bintray.com/grimler/game-packages-24 games/stable aarch64 Packages [3373 B]
Get:12 https://dl.bintray.com/grimler/science-packages-24 science/stable aarch64 Packages [5733 B]
Fetched 204 kB in 3s (61.6 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
83 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
make
0 upgraded, 1 newly installed, 0 to remove and 83 not upgraded.
Need to get 213 kB of archives.
After this operation, 872 kB of additional disk space will be used.
Get:1 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 make aarch64 4.2.1-3 [213 kB]
Fetched 213 kB in 1s (154 kB/s)
Selecting previously unselected package make.
(Reading database ... 2230 files and directories currently installed.)
Preparing to unpack .../make_4.2.1-3_aarch64.deb ...
Unpacking make (4.2.1-3) ...
Setting up make (4.2.1-3) ...
Processing triggers for man (1.14.5-1) ...
$ apt install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
autoconf automake bc binutils bison busybox bzip2 clang cmake
coreutils diffutils ed findutils flex gawk gperf gzip jsoncpp
libbz2 libexpat libllvm liblzma liblzo libmpfr libuv lzip lzop
m4 ndk-sysroot ninja patch perl pkg-config procps psmisc rhash
tar util-linux xz-utils
Suggested packages:
git golang nodejs patchelf proot python2 ruby rust subversion
The following NEW packages will be installed:
autoconf automake bc binutils bison build-essential bzip2
clang cmake coreutils diffutils ed findutils flex gawk gperf
gzip jsoncpp libexpat libllvm liblzo libmpfr libuv lzip lzop
m4 ndk-sysroot ninja patch perl pkg-config procps psmisc rhash
tar util-linux xz-utils
The following packages will be upgraded:
busybox libbz2 liblzma
3 upgraded, 37 newly installed, 0 to remove and 80 not upgraded.
Need to get 51.1 MB of archives.
After this operation, 271 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 busybox aarch64 1.30.1-7 [277 kB]
Get:2 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 libbz2 aarch64 1.0.8-2 [25.5 kB]
Get:3 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 bzip2 aarch64 1.0.8-2 [25.2 kB]
Get:4 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 coreutils aarch64 8.31-7 [679 kB]
Get:5 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 diffutils aarch64 3.7-2 [143 kB]
Get:6 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 findutils aarch64 4.6.0-4 [225 kB]
Get:7 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 gzip aarch64 1.10-2 [78.2 kB]
Get:8 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 liblzma aarch64 5.2.4-4 [134 kB]
Get:9 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 tar aarch64 1.32-4 [324 kB]
Get:10 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 xz-utils aarch64 5.2.4-4 [56.5 kB]
Get:11 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 m4 aarch64 1.4.18-1 [87.7 kB]
Get:12 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 perl aarch64 5.30.0-1 [14.4 MB]
Get:13 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 autoconf all 2.69 [283 kB]
Get:14 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 automake all 1.16.1 [319 kB]
Get:15 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 flex aarch64 2.6.4-1 [198 kB]
Get:16 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 bc aarch64 1.07.1-1 [55.6 kB]
Get:17 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 binutils aarch64 2.32-5 [2171 kB]
Get:18 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 bison aarch64 3.4.1 [305 kB]
Get:19 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 ndk-sysroot aarch64 20-1 [1444 kB]
Get:20 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 libllvm aarch64 8.0.0-6 [10.7 MB]
Get:21 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 clang aarch64 8.0.0-6 [13.7 MB]
Get:22 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 libexpat aarch64 2.2.7-1 [64.9 kB]
Get:23 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 jsoncpp aarch64 1.9.1-1 [83.8 kB]
Get:24 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 libuv aarch64 1.30.1-1 [63.6 kB]
Get:25 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 rhash aarch64 1.3.8-2 [132 kB]
Get:26 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 cmake aarch64 3.14.5-2 [3172 kB]
86% [26 cmake 851 kB/3172 kB 27%] 45.4 kB/s 1min 35s
86% [26 cmake 851 kB/3172 kB 27%] 45.4 kB/s 1min 35s
Get:27 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 gperf aarch64 3.1-4 [69.0 kB]
Get:28 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 ninja aarch64 1.9.0-2 [46.9 kB]
Get:29 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 pkg-config aarch64 0.29.2 [25.9 kB]
Get:30 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 ed aarch64 1.15 [17.9 kB]
Get:31 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 libmpfr aarch64 4.0.2-2 [245 kB]
Get:32 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 gawk aarch64 5.0.1-2 [694 kB]
Get:33 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 lzip aarch64 1.21-2 [41.9 kB]
Get:34 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 liblzo aarch64 2.10-1 [66.5 kB]
Get:35 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 lzop aarch64 1.04 [30.8 kB]
Get:36 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 patch aarch64 2.7.6-3 [76.2 kB]
Get:37 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 procps aarch64 3.3.15-3 [134 kB]
Get:38 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 psmisc aarch64 23.2 [35.9 kB]
Get:39 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 util-linux aarch64 2.34-2 [532 kB]
Get:40 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 build-essential all 3.1-1 [874 B]
Fetched 51.1 MB in 2min 32s (336 kB/s)
(Reading database ... 2239 files and directories currently installed.)
Preparing to unpack .../busybox_1.30.1-7_aarch64.deb ...
Unpacking busybox (1.30.1-7) over (1.30.1-1) ...
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (2)
$ tar
bash: /data/data/com.termux/files/usr/bin/applets/tar: No such file or directory
$ make
gcc -c base64.c
make: gcc: Command not found
make: * [Makefile:9: base64.o] Error 127
$ ls
bash: /data/data/com.termux/files/usr/bin/applets/ls: No such file or directory
$ apt install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
autoconf automake bc binutils bison bzip2 clang cmake
coreutils diffutils ed findutils flex gawk gperf gzip jsoncpp
libbz2 libexpat libllvm liblzma liblzo libmpfr libuv lzip lzop
m4 ndk-sysroot ninja patch perl pkg-config procps psmisc rhash
tar util-linux xz-utils
Suggested packages:
git golang nodejs patchelf proot python2 ruby rust subversion
The following NEW packages will be installed:
autoconf automake bc binutils bison build-essential bzip2
clang cmake coreutils diffutils ed findutils flex gawk gperf
gzip jsoncpp libexpat libllvm liblzo libmpfr libuv lzip lzop
m4 ndk-sysroot ninja patch perl pkg-config procps psmisc rhash
tar util-linux xz-utils
The following packages will be upgraded:
libbz2 liblzma
2 upgraded, 37 newly installed, 0 to remove and 80 not upgraded.
1 not fully installed or removed.
Need to get 0 B/50.8 MB of archives.
After this operation, 271 MB of additional disk space will be used.
Do you want to continue? [Y/n]
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (2)
$ apt up
E: Invalid operation up
$
$ tar
bash: /data/data/com.termux/files/usr/bin/applets/tar: No such file or directory
$ apt install tar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tar
0 upgraded, 1 newly installed, 0 to remove and 82 not upgraded.
1 not fully installed or removed.
Need to get 0 B/324 kB of archives.
After this operation, 1176 kB of additional disk space will be used.
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (2)
$
``
''''""""
Expected behavior
Something else
Additional information
Post output of command termux-info.
If you are rooted or have access to adb then capture a logcat with logcat -d "*:W", from a adb or root shell.
When I open termux I get this:
``
/data/data/com.termux/files/usr/bin/login: 4: /data/data/com.termux/files/usr/bin/login: cat: not found
$
$ ls
The program 'ls' is not installed. Install it by executing:
pkg install busybox
or
pkg install coreutils
$ pwd
/data/data/com.termux/files/home
$ man
usage: man [-acfhklw] [-C file] [-M path] [-m path] [-S subsection]
[[-s] section] name ...
$ #lookes like someting distroyed most basic unix commands
$
``
Lets try
[[-s] section] name ...
$ #lookes like someting distroyed most basic unix commands
$ termux-info
/data/data/com.termux/files/usr/bin/termux-info: 12: /data/data/com.termux/files/usr/bin/termux-info: tail: not found
/data/data/com.termux/files/usr/bin/termux-info: 23: /data/data/com.termux/files/usr/bin/termux-info: awk: not found
/data/data/com.termux/files/usr/bin/termux-info: 25: /data/data/com.termux/files/usr/bin/termux-info: uname: not found
Updatable packages:
All packages up to date
Subscribed repositories:
System information:
Termux-packages arch:
aarch64
Android version:
8.1.0
Device manufacturer:
BlackBerry
Device model:
BBB100-2
$
You see same error
Btw is there any way to fix this or do I have to reinstall termux?
Thanks for any help in advance and keep up the good work but please test everything more until releasing it
Do pkg upgrade before installing anything.
Package manager doesn't have protection against backwards-incompatible changes.
In short:
Busybox is being phased-out and replaced by standalone packages.
Development stuff is no longer split to a separate package.
I just had the same issue (I just did a "apt upgrade"). I think "pkg install coreutils" did the trick (for now). Also some repos (science, root, game) don't have a valid signature anymore. I've disabled them as well. Things look OK-ish now.
FYI, apt 1.4.9-6 and dpkg 1.19.7-1 are not released on termux.net repository for some reason but busybox was still updated and broke everything. Hope @fornwall will upload apt & dpkg soon.
The problem with "not valid signature" is due to some missing dependencies required by apk-key utility. If apt still works, install findutils grep sed tar xz-utils less (new deps for apt and dpkg).
This alone didn't help, but installing coreutils did.
I found the advice to remove the /data/data/com.termux/files/usr directory quite helpful:
https://wiki.termux.com/wiki/Recover_a_broken_environment#If_the_problem_is_not_with_the_dotfiles
I found the advice to remove the
/data/data/com.termux/files/usrdirectory quite helpful:Except:
$ rm -rf /data/data/com.termux/files/usr
The program 'rm' is not installed.
Install it by executing:
pkg install busybox
or
pkg install coreutils
The program 'rm' is not installed.
In /system/bin it is always installed. That's why Termux has failsafe shell.
https://wiki.termux.com/wiki/Recover_a_broken_environment
/system/bin/rm -rf /data/data/com.termux/files/usr
Install it by executing:
pkg install busybox
or
pkg install coreutils
Wrong suggestion. Busybox is deprecated and does not provide applets in Termux anymore. We even removed applets dir from PATH.
Your environment is very outdated if still relies on busybox.
Most helpful comment
I found the advice to remove the
/data/data/com.termux/files/usrdirectory quite helpful:https://wiki.termux.com/wiki/Recover_a_broken_environment#If_the_problem_is_not_with_the_dotfiles