Steps to Reproduce:
Does not install the following libraries
libgtk-x11-2.0.so.0
libgdk-x11-2.0.so.0
libatk-1.0.so.0
libpangocairo-1.0.so.0
libcairo.so.2
libpango-1.0.so.0
libfreetype.so.6
libfontconfig.so.1
libdbus-1.so.3
libXi.so.6
libXcursor.so.1
libXdamage.so.1
libXrandr.so.2
libXcomposite.so.1
libXext.so.6
libXfixes.so.3
libXrender.so.1
libXtst.so.6
libgconf-2.so.4
libasound.so.2
libcups.so.2
libexpat.so.1
The dependencies of the .deb package are
root@2cb088d9c151:/# apt-cache show code | grep ^Depends
Depends: libnotify4, libnss3
libgtk2.0
libatk1.0
libpango1.0
libpangocairo-1.0
libcairo2
libfreetype6
libfontconfig1
libdbus-1-3
libxi6
libxcursor1
libxdamage1
libxrandr2
libxcomposite1
libxext6
libxfixes3
libxrender1
libxtst6
libgconf-2-4
libasound2
libcups2
libexpat1
and now
libxss1
/usr/share/code/bin/../code: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
In my case I only needed to install libgconf-2-4 manually, on elementary OS 0.4 (uses Ubuntu 16.04 repos).
/usr/share/code/bin/../code: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
This was on 32-bit Ubuntu 12.04, after installing code_1.8.1-1482159060_i386.deb. Installing libxss1 fixed my problem.
Ubuntu 16.04.2 required me to perform:
sudo apt-get install libgtk2.0-0 libxss-dev libgconf-2-4 libasound2
after installing the code package to get it to work (i started with a system that was configured only for text usage)
As a minor tweak to the workaround above, I don't think you necessarily need/want the -dev packages. I got it working on Ubuntu server 16.04 with just:
sudo apt install libgtk2.0-0 libxss1 libasound2
current deb vs code installed , installed the libs
now when i type code -verbose all i see is a version number and a code of some kind but no error message and no ui.
i am running wsl / ubuntu and xeyes / xclock / xclalc all work with xming on the machine.
any idea what i am missing ?
@figuerres we don't support the Linux binary on WSL and I wouldn't have expected it to ever work reliably.
@Tyriar
i have seen that some folks had it work, so i am trying it.
here is a question: what IS supported ?
the whole thing is confusing as heck to me.....
if i want to use the linux tools it seems like a mess, the two file systems and which can read what and which can run what.....
i am starting to feel that i should just run a linux box for stuff and forget this linux on windows hack.
just too many quirks...
@figuerres AFAIK that while it's possible, WSL was not designed to launch Linux GUI apps under Windows. It's primary purpose is to bring cli tools to Windows. When you install VS Code on Windows it will install a shell script to the path which will launch the Windows version, this is supported.
I tend to generally agree with you that it's too quirky atm which is why I'm sticking with Powershell until WSL is more mature and better support is added to vscode.
Also the correct issue to discuss this on is https://github.com/Microsoft/vscode/issues/13138 (of which you have participated), please keep discussion over there to keep things organized. This issue is specifically about dependencies declared in the deb.
The 1.9.3 deb also suffers from this problem:
root@a6ce929114ef:/# dpkg -I code_1.19.3-1516876437_amd64.deb | grep Depends
Depends: libnotify4, libnss3, gnupg, apt, libxkbfile1, libgconf-2-4, libsecret-1-0
root@a6ce929114ef:/# ldd /usr/share/code/code | grep not
libgtk-x11-2.0.so.0 => not found
libgdk-x11-2.0.so.0 => not found
libXss.so.1 => not found
libasound.so.2 => not found
I was seeing error while loading shared libraries libgtk-x11-2.0.so.0 after upgraded to Ubuntu 18.04 from 17.10.
Reinstall didn't help, but sudo apt-get install libgtk2.0-0 did fix it.
I experienced this issue today installing Code 1.23 on Debian 9.4 stretch on Crostini on a Pixelbook.
I resolved the issue with the command below. Looks like this package is not in the dependencies list for the code package for Debian.
Code 1.23 is still the current version installed from the Microsoft repo.
sudo apt-get install libxss1
In September 2018 the issue still exists (at least on Ubuntu)
keesj@server:~$ code
/usr/share/code/bin/../code: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
keesj@server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
--
root@server:~# dpkg -I code_1.27.1-1536226049_amd64.deb
new Debian package, version 2.0.
size 45361392 bytes: control archive=2319 bytes.
710 bytes, 14 lines control
2838 bytes, 72 lines * postinst #!/usr/bin/env
189 bytes, 5 lines * postrm #!/bin/bash
274 bytes, 6 lines * prerm #!/usr/bin/env
Package: code
Version: 1.27.1-1536226049
Section: devel
Depends: libnotify4, libnss3 (>= 2:3.26), gnupg, apt, libxkbfile1, libgconf-2-4, libsecret-1-0, libgtk-3-0 (>= 3.10.0)
Priority: optional
Architecture: amd64
Maintainer: Microsoft Corporation vscode-linux@microsoft.com
Homepage: https://code.visualstudio.com/
Installed-Size: 200215
Provides: visual-studio-code
Conflicts: visual-studio-code
Replaces: visual-studio-code
Description: Code editing. Redefined.
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ.
--
Somehow that dependency does not get dragged in.
The same is true for libasound2
keesj@server:~$ code
/usr/share/code/bin/../code: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory
--
The installation I am using is based on lxc-containers (e.g. following)
https://help.ubuntu.com/lts/serverguide/lxc.html
lxc-create -t download -n u1 -- --dist ubuntu --release bionic --arch amd64
followed by a download of the .deb file
dpkg -i code.deb (gets expected errors)
apt-get install -f (installed dependencies)
dpkg -i code.deb
This is what worked for me in WSL Ubuntu 18.04:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code
sudo apt-get install x11-apps
sudo apt-get install xterm
export DISPLAY=:0
code &
Can confirm at least libasound2 is required. I'm glad to help with PR; not sure whether this is the file to modify:
I think we can test the dependency in a Vagrant box, where most GUI related packages are not pre-installed.
libsecret-1-dev needs to be added to this list: required for keytar/credential storage.
@smug-haus I don鈥檛 think any -dev package is required. libsecret-1-0 should have already provided the functionality.
@FranklinYu one would assume that, however keytar's documentation says you need it.
Additionally, I was unable to get Team Chat working without it; and as far as I can tell that extension implements credential storage correctly/as intended.
@smug-haus The documentation didn鈥檛 say whether it鈥檚 runtime dependency. I think it is only used to compile.
Most helpful comment
Ubuntu 16.04.2 required me to perform:
sudo apt-get install libgtk2.0-0 libxss-dev libgconf-2-4 libasound2after installing the code package to get it to work (i started with a system that was configured only for text usage)