electron: Electron apps can't find libcurl.so.4

I’m looking for a nice Git GUI, and so I came across gitkraken the other day. However, it wouldn’t start but fail with

/usr/lib ► gitkraken
Node started time: 1488472940858
libcurl.so.4: cannot open shared object file: No such file or directory
Error: libcurl.so.4: cannot open shared object file: No such file or directory
    at Error (native)
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:158:20)
    at Object.Module._extensions..node (module.js:568:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:169:18)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/share/gitkraken/resources/app.asar/node_modules/nodegit/dist/nodegit.js:11:12)
    at Module._compile (module.js:541:32)
    ...

I tried to fix the issue with

sudo ln -sf /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0 libcurl.so.4

and, as recommended by nodegit:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libstdc++-4.9-dev

but to no avail. Naturally I would have thought this to be a problem with the gitkraken app, but today I chose to try and run Cycligent Git Tool, and look what happened:

► /usr/share/CycligentGitTool/CycligentGitTool
A JavaScript error occurred in the main process
Uncaught Exception:
Error: libcurl.so.4: cannot open shared object file: No such file or directory
    at Error (native)
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
    at Object.Module._extensions..node (module.js:583:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/share/CycligentGitTool/resources/app/cygit/server/node_modules/nodegit-electron-linux-x64/dist/nodegit.js:11:12)

so it would appear Electron has a problem here. The strange thing is that I can start Atom, and I never had a problem like that with it (well, maybe it doesn’t even need libcurl, of course).

This is on Linux Mint Cinnamon:

► uname -a && cat /etc/issue
Linux enceladus 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Linux Mint 18 Sarah

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

@loveencounterflow I had the same issue on Linux Mint 18 Cinnamon, sudo apt-get install curl libcurl3 solved the problem for me.

Credit: http://askubuntu.com/a/893117

Thanks to this issue and the comments I was able to solve my problem as well, I’m using gitkraken as well but run it on Fedora which the libcurl naming is a bit different. so I created a new symlink named libcurl-gnutls.so.4 which solved my problem.

[/usr/lib64] # ln -s libcurl.so.4.4.0 libcurl-gnutls.so.4

On openSUSE:

sudo ln -s /usr/lib64/libcurl.so /usr/lib64/libcurl-gnutls.so.4

@robersongomes This worked for me. Many thanks!!!

@loveencounterflow I had the same issue on Linux Mint 18 Cinnamon, sudo apt-get install curl libcurl3 solved the problem for me. Credit: http://askubuntu.com/a/893117

Reading package lists … Done Building a dependency tree Read status information … Done Some packages cannot be installed. Perhaps what you are asking is impracticable, or you are using an unstable version of the distribution, where The packages you requested have not yet been created or have been removed from Incoming. The following information may help you:

The following packages have unsatisfied dependencies:   curl: Depends: libcurl4 (= 7.58.0-2ubuntu3.8) but it will not be installed E: Unable to fix errors: you have broken packages.

it helped: https://askubuntu.com/questions/1014645/unmet-dependencies-when-trying-to-install-curl-on-ubuntu-16-04

sudo apt install curl

I’m running into this problem on Ubuntu 18.04,

To solve this, I just uninstalled and used the Gitkraken Snap from the Ubuntu Software Store.

@rabin-io answer solved my issue on CentOS. Thx

@robersongomes YES!

I dare hereby re-open the commit to encourage adding this—sudo apt-get install curl libcurl3—to be added to the installation instructions where seen fit.