insomnia: [bug] libgtk-x11-2.0.so.0: cannot open shared object file when installing plugins

  • Insomnia Version: v5.16.1
  • Operating System: ubuntu18.04

Details

When installing a plugin, Insomnia complains that /snap/insomnia/12/insomnia: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

Howere, there is libgtk-x11-2.0.so.0 in my computer.

locate libgtk-x11-2.0.so.0
/snap/chromium/274/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/chromium/274/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/snap/electronic-wechat/7/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/electronic-wechat/7/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/snap/gnome-3-26-1604/59/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/gnome-3-26-1604/59/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/snap/insomnia/12/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/insomnia/12/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/snap/slack/6/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/slack/6/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/snap/tusk/15/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/tusk/15/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/snap/zeal-casept/26/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/snap/zeal-casept/26/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0.2400.32
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 29 (1 by maintainers)

Most upvoted comments

Manual installation worked for me. Note, that I have installed Insomnia on Fedora using snap.

  1. Go to your plugins directory:
cd /home/user/snap/insomnia/current/.config/Insomnia/plugins
  1. Install the plugin manually (in this case it’s insomnia-plugin-default-headers plugin):
npm install insomnia-plugin-default-headers
  1. Reload insomnia plugins: Tools -> Reload plugins

@gschier:

I suggest to put this into Plugins documentation. I can make a PR if desired.

Solution:

cd /home/$USER/snap/insomnia/current/.config/Insomnia/plugins
npm init -y
npm install insomnia-plugin-name

Manual installation worked for me. Note, that I have installed Insomnia on Fedora using snap.

  1. Go to your plugins directory:
cd /home/user/snap/insomnia/current/.config/Insomnia/plugins
  1. Install the plugin manually (in this case it’s insomnia-plugin-default-headers plugin):
npm install insomnia-plugin-default-headers
  1. Reload insomnia plugins: Tools -> Reload plugins

@gschier: I suggest to put this into Plugins documentation. I can make a PR if desired.

I tried this but can’t install manually. image

I use yarn add insomnia-plugin-default-headers instand of npm install insomnia-plugin-default-headers, it will download to the directory, it ok

Have the same issue on Fedora 29 when clicking on Install plugin. Insomnia 6.3.2 installed using snap

Insomnia npm error: Command failed: /snap/insomnia/24/insomnia --no-deprecation /snap/insomnia/24/resources/bin/yarn-standalone.js info Insomnia --json
/snap/insomnia/24/insomnia: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

gtk3 is installed and dependency is at /usr/lib64/libgtk-3.so.0

For the ones who wish to use bash; You can add an executable script with the following contents:

#!/bin/bash

plugins=( \
    "insomnia-plugin-XXXX" \
    "insomnia-plugin-YYYY"
)

echo -e 'Install Insomnia plugins'

pluginsDir="$HOME/snap/insomnia/current/.config/Insomnia/plugins"

which yarn || sudo apt install yarn

for plugin in "${plugins[@]}"; do
    (cd $pluginsDir && yarn add $plugin)
done

echo -e 'done'

Insomnia v2020.4.1 installed via snap v2.46.1+20.04 I am getting:

Error: Yarn error /snap/insomnia/105/insomnia: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

    at file:///snap/insomnia/105/resources/app.asar/bundle.js:99635:16
    at ChildProcess.exithandler (child_process.js:311:5)
    at ChildProcess.emit (events.js:223:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:223:5)
    at Pipe.<anonymous> (net.js:664:12)

while trying to install plugin.

This shared library seems to be installed: /snap/gnome-3-28-1804/128/usr/lib/x86_64-linux-gnu/libX11.so.6 /snap/gnome-3-28-1804/128/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0

Manually installing plugin as suggested above works.

Solution:

cd /home/$USER/snap/insomnia/current/.config/Insomnia/plugins
npm init -y
npm install insomnia-plugin-name

solved for me !!!

Manual installation worked for me. Note, that I have installed Insomnia on Fedora using snap.

  1. Go to your plugins directory:
cd /home/user/snap/insomnia/current/.config/Insomnia/plugins
  1. Install the plugin manually (in this case it’s insomnia-plugin-default-headers plugin):
npm install insomnia-plugin-default-headers
  1. Reload insomnia plugins: Tools -> Reload plugins

@gschier:

I suggest to put this into Plugins documentation. I can make a PR if desired.

I tried this but can’t install manually. image

I just played around with this a bit and it seems like this happens in both the Snap and AppImage packages. I assume it has something to do with the plugin install script launching a new process. It seems to be breaking out of the app container and not being able to find the dependencies anymore.

For now, if you’re using Ubuntu, the deb package should work. You can also install plugins into the plugins folder manually using npm or yarn.