Termux-app: CANNOT LINK EXECUTABLE DEPENDENCIES: library "libgnustl_shared.so" not found

Created on 14 May 2016  路  8Comments  路  Source: termux/termux-app

apt command not working when switched to root user.
it says "CANNOT LINK EXECUTABLE DEPENDENCIES: library "libgnustl_shared.so" not found"

Actually non of the things which are installed using apt are working as root user.
I have Android 5.1.1, cyanogenmod 21.1

Most helpful comment

As @deed02392 says, run

export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib

in the root shell. This environment variable is needed for shared libraries to be found by Termux-supplied binaries.

All 8 comments

Also having this issue, marshmallow hani rom 910U

Fix is to set LD LIBRARY PATH envar in the privileged shell. Check with printenv.

As @deed02392 says, run

export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib

in the root shell. This environment variable is needed for shared libraries to be found by Termux-supplied binaries.

Apologies. I know the issue is closed, however I do not believe it has been clearly resolved. Yes, the user may export the envar $LD_LIBRARY_PATH as root, export /system/bin +/- /system/xbin to $PATH for system binary support but these additions must be done each time the privileged user is invoked.

Not so much a problem as it is an inconvenience, in Android - by default - /system/etc/mkshrc (from mksh, a port of ksh) sets the root env and mksh becomes the login shell upon invoking su. Depending on the device, ROM developers, the implementation is either rudimentary and dated or updated to more recent & mature code. For example, the mkshrc file on my LGG2 is bare bones by comparison to mkshrc in my N6 - both running custom 6.0.1.

I've tried sourcing .bashrc to this file to extend the referenced paths and variables with a modicum of success. Yet, exiting to the regular user account and invoking su again voids all prior changes, including $LD_LIBRARY_PATH though it is referenced when running printenv as root.

I'm unsure how to proceed. Should the .bashrc be copied to /system/etc independently so the user can select his/her preferred login shell? If this is even possible, it takes Termux beyond its present scope. In the event Termux concedes to its users, the majority I estimate are root, passwd and PAM functionality should be deployed IMHO. At the very least, this would allow packages such as nmap, traceroute, ifconfig, et al. and their dependencies to be installed in the manner in which they are used by the privileged user.

https://www.mirbsd.org/mksh.htm

EDIT: Added URL

@tinydynamite00 Thanks for the input! I agree that the situation for root users can be improved a lot, perhaps by creating a 'su' wrapper which preserves the relevant environment and launches the normal shell. Let's keep the "improve Termux for root users" discussion at https://github.com/termux/termux-app/issues/61!

@deed and @forn thanks it worked..

Is this really resolved? I have to manually setenv each time. Why is this issue closed?

is problem solved? i do what @fornwall said and still not working.

Was this page helpful?
0 / 5 - 0 ratings