AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.7k stars 557 forks source link

libz.so cannot open shared object file [ARM64] #1092

Open mihaiav opened 3 years ago

mihaiav commented 3 years ago

I'm building an app using Electron builder with AppImage as target. It worked fine for a while but now I can't run it anymore. Perhaps I updated some libraries or just run apt-get update but I didn't expect that to break AppImage application as they are supposed to be self contained anyway. I get an error that says

libz.so: cannot open shared objet files: No such file or directory

The error is not very helpful as it doesn't say which shared object files it tries to open.

Additionally the error is very bad for the user experience/debug as well as it's visible only when you run the app from the command line. If you run it from GUI you get no error at all... it just doesn't run.

Arch is ARM64.

I also have a x64 built that I test now on a different machine (X64) and works as expected.


$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy

$ uname -a
Linux <redacted-user> 5.8.0-1007-raspi #10-Ubuntu SMP PREEMPT Thus Nov 5 17:52:40 UTC 2020 aarch64 aarch64 GNU/Linux 
hdmi
mihaiav commented 3 years ago

Update:

I browsed through the issues and found how to fix the libz.so issue https://github.com/AppImage/AppImageKit/issues/964

After installing zlib1g-dev I got another error about libxss1 so I installed this as well and now the app runs.

After all this I find the experience quite bad compared with windows or mac and perhaps it's also one of the reasons(among others) why linux adoption is so low. Seems even installing an app that is supposed to be self contained and "just work" on any linux distribution becomes a big adventure. How "fatter" would the apps get if they would have libz.so and libxss included in the appimage itself?

TheAssassin commented 3 years ago

How "fatter" would the apps get if they would have libz.so and libxss included in the appimage itself?

You should've checked our docs. There are other reasons not to bundle such basic libraries. See https://docs.appimage.org/introduction/concepts.html#build-on-old-systems-run-on-newer-systems for more information.

The issue you have there is that the application you build links to a library name that is not commonly available. Make it link against libz.so.1 and you won't have issues any more. This link contains the major version, and is omnipresent all non-esoteric distros.

mihaiav commented 3 years ago

I may be wrong but from the comments I read on https://github.com/AppImage/AppImageKit/issues/964 the "solution" is actually a workaround https://github.com/CollaboraOnline/richdocumentscode/issues/68#issuecomment-693432138 and the issue seems to be caused by the appimagetool which I assume is used by Electron builder, not "my app".

libxss seems to an issue of my app indeed which is actually an issue of Electron inherited from the Chrome/Chromium browser.

Muthu-AMMEW commented 1 year ago

Install zlib1g-dev on Ubuntu or other Linux. like this.

sudo apt-get update -y

sudo apt-get install -y zlib1g-dev

Insert the above two command lines on your terminal. After, Restart your computer or server. Later finishing your problems.

RanHuang commented 1 year ago
$ lsb_release -a
LSB Version:    :core-4.1-aarch64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.6.1810 (AltArch)
Release:    7.6.1810
Codename:   AltArch

my solution:

sudo yum install -y zlib
rpm -ql zlib
sudo ln -s /usr/lib64/libz.so.1 /usr/lib64/libz.so

image

EloWeld commented 1 year ago

Install zlib1g-dev on Ubuntu or other Linux. like this.

sudo apt-get update -y

sudo apt-get install -y zlib1g-dev

Insert the above two command lines on your terminal. After, Restart your computer or server. Later finishing your problems.

Man, respect. It works