Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read this, if you have "CANNOT LINK EXECUTABLE" after update #1703

Closed
ghost opened this issue Aug 10, 2020 · 24 comments
Closed

Read this, if you have "CANNOT LINK EXECUTABLE" after update #1703

ghost opened this issue Aug 10, 2020 · 24 comments

Comments

@ghost
Copy link

ghost commented Aug 10, 2020

Version 0.96 and higher of Termux application removes support of so-called "legacy environment" (set of packages used for Android 5.x-6.x). Packages installed from https://termux.net will no longer work. Packages mixed from https://termux.net and other sources will no longer work too.

What to do:

Open failsafe shell, copy important files to /sdcard and then erase Termux application data.

Alternatively, you may attempt to use termux-upgrade-repo script from failsafe shell:

export PREFIX=/data/data/com.termux/files/usr
export LD_LIBRARY_PATH=$PREFIX/lib
export PATH=$PREFIX/bin
termux-upgrade-repo

If no termux-upgrade-repo available, follow #1703 (comment).


Failsafe shell how-to: https://wiki.termux.com/wiki/Recover_a_broken_environment#Launching_a_Failsafe_Session


P.S. Another major environment update is coming soon, including packaging format change. Brief info is available at https://github.com/termux/termux-packages/wiki/Termux-and-Android-10.

@ghost ghost added the information label Aug 10, 2020
@ghost ghost pinned this issue Aug 10, 2020
@butla
Copy link

butla commented Aug 11, 2020

Hey @xeffyr, what does

You may attempt to use termux-upgrade-repo script from failsafe shell:

mean? To do it instead of erasing Termux application data? Or after it? What is the purpose of termux-upgrade-repo?

@ghost
Copy link
Author

ghost commented Aug 11, 2020

Yes, instead of completely erasing data. termux-upgrade-repo will erase only $PREFIX, data of $HOME won't be touched and will generate a script for reinstalling packages.

@butla
Copy link

butla commented Aug 11, 2020

Yup, can confirm that everything looks OK.

@deftdawg
Copy link

Any shell I open results in this as of Aug 8 build...

CANNOT LINK EXECUTABLE "cat": library "libandroid-support.so" not found
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/bin/bash": library "libandroid-support.so" not found

[Process completed (code 1) - press Enter]

Seems like the environment shouldn't corrupt itself

@Grimler91
Copy link
Member

@deftdawg environment broke after termux-app was updated, but packages have not been updated for 8 months.

If you want to ensure environment does not break then either never update app or packages, or keep both up to date.

@2E0PGS
Copy link

2E0PGS commented Aug 13, 2020

Any shell I open results in this as of Aug 8 build...

CANNOT LINK EXECUTABLE "cat": library "libandroid-support.so" not found
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/bin/bash": library "libandroid-support.so" not found

[Process completed (code 1) - press Enter]

Seems like the environment shouldn't corrupt itself

I had the exact same issue. One day it just corruped itself with same error as you. I didn't recently install or upgrade any packages inside termux.

To fix it, I just uninstalled and reinstalled the app. You do however loose the previous termux file system contents. Annoying but seems specific to older installation since my newer phone's termux never corrupted itself.

@chrylis
Copy link

chrylis commented Aug 15, 2020

termux-upgrade-repo: not found

This has been a really frustrating experience for no good reason. I wasn't aware that I needed to perform a manual upgrade step just to keep bash running, and nothing in the upgrade process ever notified me. Now the recommended fix not only doesn't work, but apparently couldn't possibly work.

@ghost
Copy link
Author

ghost commented Aug 15, 2020

Now the recommended fix not only doesn't work, but apparently couldn't possibly work.

What termux-upgrade-repo do is only

  1. Generate reinstallation script
  2. rm -rf $PREFIX
    That's ALL!

It may not exist if environment is very outdated or is a mix of packages from termux.net and bintray.

I wasn't aware that I needed to perform a manual upgrade step

Have you ever run pkg upgrade? If you did that periodically, then motd message would be switched to one claimin that you are running "legacy environment". Btw, there were more than a half of year between legacy environment deprecation (01.01.2020) and final drop.

Keeping environment out-of-sync with app will broke it at some point because environment is not independent. Either update both or do not update at all.

@giner
Copy link

giner commented Aug 18, 2020

Somehow while using termux almost everyday I hadn't noticed a deprecation warning before everything broke. Was there one?

@ghost
Copy link
Author

ghost commented Aug 19, 2020

Somehow while using termux almost everyday I hadn't noticed a deprecation warning before everything broke.

Everyday, without updating packages and even without checking community pages. That's why you have not been notified.

Was there one?

Significant changes are always posted on community pages and, if needed, being sent as update of termux-tools package which provides a motd displayed during session startup.

Everyone who has up-to-date packages of https://termux.net, will have a warning about legacy environment usage. Commit termux/termux-packages@97b5924.

I have also did an announcement about deprecation of Android 5/6 compatibility branch on Github (termux/termux-packages#4467) and Reddit https://www.reddit.com/r/termux/comments/dnzdbs/end_of_android56_support_on_20200101/.

@giner
Copy link

giner commented Aug 19, 2020

I do update termux itself from F-Droid regularly but not packages

@kaefer3000
Copy link

kaefer3000 commented Aug 20, 2020

@chrylis the following helped me:

@ssixty
Copy link

ssixty commented Aug 25, 2020

Thanks kafer but your instructions are still a little vague, I was getting errors that chmod couldn't be found. here's exactly what I did in the end - don't refer to the instructions in OP at all.

@petep0p
Copy link

petep0p commented Aug 26, 2020

Thanks kafer but your instructions are still a little vague, I was getting errors that chmod couldn't be found. here's exactly what I did in the end - don't refer to the instructions in OP at all.

this worked for me with one small change:
#!/system/bin/sh
should be the initial line rather than just /bin/sh
it kept saying "No such file or directory" when I tried to execute, and i was like "but it's right there!". it took me forever to realize that it wasn't the script itself, but sh that wasn't found.

@ssixty
Copy link

ssixty commented Aug 26, 2020

this worked for me with one small change:

Interesting, I didn't run into that - thanks for the extra info.

@ghost
Copy link
Author

ghost commented Aug 26, 2020

@ssixty Because script uses #!/bin/sh as default shebang. It is being rewritten into something like #!/data/data/com.termux/files/usr/bin/sh during packaging of termux-tools. As some devices (and probably yours) have /bin symlinked to /system/bin, ./termux-upgrade-repo may get executed without issues even if default shebang was used.

@bensteinberg
Copy link

export PREFIX=/data/data/com.termux/files/usr
export LD_LIBRARY_PATH=$PREFIX/lib
export PATH=$PREFIX/bin
termux-upgrade-repo

@xeffyr's instructions above worked for me with the following change, adding the existing $PATH to the new one:

export PREFIX=/data/data/com.termux/files/usr
export LD_LIBRARY_PATH=$PREFIX/lib
export PATH=$PREFIX/bin:$PATH
termux-upgrade-repo

Otherwise the script couldn't find chmod.

@hg2581
Copy link

hg2581 commented Sep 10, 2020

I am on Android 7.1.2 and ran into this issue a couple of weeks ago. While I had noticed fr some time that various apps were no longer upgraded when I typed pkg upgrade, I had no idea that the entire termux setup would collapse... I just checked and I am running version 0.98 of termux on this tablet.

Anyway, I found this page and looked for the failsafe-shell and cannot find it. As pointed out, running Android 7 there is no failsafe-shell option when long-pressing the app icon but more importantly, there is no menu after loading termux where I can start this failsafe-shell. Instead. I am staring at the error messages and cannot see that I can get past them.

So, how do I get to the failsafe-shell and then proceed to recover a working termux setup on my tablet?

@ghost
Copy link
Author

ghost commented Sep 10, 2020

So, how do I get to the failsafe-shell and then proceed to recover a working termux setup on my tablet?

There 2 ways for accessing failsafe shell: through drawer and with shortcut. Shortcuts displaying depends on used launcher and OS. So you stick to drawer option.

  1. Open Termux.
  2. Swipe rightwards to open drawer.
  3. Long press on button "New session".
    - As in https://wiki.termux.com/wiki/Recover_a_broken_environment#Launching_a_Failsafe_Session.

@hg2581
Copy link

hg2581 commented Sep 10, 2020 via email

@ghost
Copy link
Author

ghost commented Sep 10, 2020

Am I missing something?

Yes,

  • You didn't read the instructions or do not understand them.
  • Or you just use a very special Termux which doesn't have anything except terminal window.

@ghost
Copy link
Author

ghost commented Sep 10, 2020

I understand that reading text may be very difficult (btw, why using Termux in this case???), so here is a video: https://imgur.com/a/xIBiW2c

Added to https://wiki.termux.com/wiki/Recover_a_broken_environment. I was sure that everyone can read the article properly...

@hg2581
Copy link

hg2581 commented Sep 10, 2020

No need to be sarcastic and the video also did not show exactly where to start swiping. I now began swiping a little past the left edge of the terminal window and was able to launch a failsafe session. I'll see where it goes from here.

@cauerego
Copy link

cauerego commented Sep 26, 2020

just wanted to point for future reference that i was having an issue with xonsh and some corrupted configuration from xconfig web, i believe:

xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
ModuleNotFoundError: No module named 'prompt_toolkit'
Failed to load xontrib abbrevs.

which brought me to a similar status unable to use termux.

and finding out about the failsafe here was the missing piece for me! 🤣

i knew there should be some such way to fix it, but just couldn't find it anywhere else!!

@ghost ghost closed this as completed Oct 2, 2020
@termux termux locked as resolved and limited conversation to collaborators Oct 2, 2020
@ghost ghost unpinned this issue Oct 2, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests