Problem description
When using termux, it is found that the permissions are not enough by using commands. After switching to root by using Su, it is found that many previous commands cannot be used
First, echo $path to view the environment variable of root
Results: in/SBIN/Su/Su/bin/Su/xbin/system/bin/system/xbin
It is found that these three are all in the root path, without/data/data/com.termux/files/usr/bin, so the command here can’t be executed naturally
Exit switch to normal user.
Echo $path view environment variables
The value is/data/data/com. Termux/files/usr/bin/data/data/com. Termux/files/usr/bin/applets
That is to say, you just need to tell root the variables of ordinary users
Here is the solution——————————————————————————————-
In order to ensure the security of the system, the temporary variable is used to save the error
export PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:$PATH
(tell root the executable
Note that there is no space beside the equal sign, the colon in English: segmentation, the front part is the path value of ordinary users: the Lib path of ordinary users (because some commands also need the library files we download), just paste it
)
export LD_ LIBRARY_ PATH=/data/data/com.termux/files/usr/lib
(link LIB)
be careful!! For the sake of safety, the operation I posted is temporary. Exit will restore the original identity or turn it off or reopen it. But it’s absolutely safe.
For your convenience, you can create a script to quickly use the downloaded function.
Cd ~ (home directory)
VIM getmytermuxorders (create a file)
Enter the following:
#!/bin/bash
export PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:$PATH
export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
echo "LYM_nb"
: WQ save exit
Then exit returns to the original user
When you want to use the root permission again in the future:
Su or TSU comes to root
Run the source command directly in the home directory
source getMyTermuxOrders
If output lym_ NB means that all bin functions of termux have been obtained
You can also use export, echo $path, env and other commands to confirm
Read More:
- [Solved] Sed Failed to Reference Variable error: extra characters after command
- The JSON variable is parsed in the shell to obtain the value corresponding to the key
- Setting up automatic networking alias for Mac Terminal
- [Solved] Ubuntu pip Install Error: which is not on PATH
- SCP path contains special characters Error [How to Solve]
- Anaconda prompt running environment.yml [How to Solve]
- Hadoop 3.2.0 idea development environment construction and HDFS read write API operation
- Error: error from slirp4netns while setting up port redirection: map[desc:bad request: add_hostfwd:
- [Solved] configure: error: no acceptable C compiler found in $PATH
- Resolving yum source-related issues: Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
- C# WinForm gets the storage path of the selected file
- [Solved] configure:error:no acceptable C compiler found in $PATH
- hb set Error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor (openharmony Compile ubuntu20.04 official document)
- [Solved] Cannot find command ‘git‘ – do you have ‘git‘ installed and in your PATH?
- Configure the node environment under Linux, internal/modules/cjs/loader.js:583 throw err; solution
- [Solved] Environment: failed conda all InvalidVersionSpecError: Invalid version spec: =2.7
- [Solved] zookeeper Cluster error: Error: JAVA_HOME is not set and java could not be found in PATH.
- [Solved] Homebrew Error: xcrun: error: invalid active developer path
- [Solved] Centos7 Error: gcc: configure: error: in build‘: configure: error: no acceptable C compiler found in $PATH
- Error: loading shared libraries: cannot open shared object file: No such file or directory