Ubuntu 18 中启动vscode 没有反应的解决办法

arm架构中(树莓派4b),ubuntu 18中 安装vscode后打开vscode没有任何反应,无法正常打开,然后用日志模式后

code --verbose

报错信息为 

Xlib:  extension "XInputExtension" missing on display ":1".
Xlib:  extension "XInputExtension" missing on display ":1".
[12192:1109/190657.768585:ERROR:electron_browser_main_parts.cc(200)] X IO error received (X server probably went away)

 

一开始找到了一些方法,但不管用,例如对~/.config/Code 进行操作 (17条消息) ubuntu系统中vscode无法打开_Fan0920的专栏-CSDN博客

delia@wmm-Inspiron-N4050:~/Downloads$ cd ~/.config/
delia@wmm-Inspiron-N4050:~/.config$ sudo rm -rf ./Code/
[sudo] password for delia: 
delia@wmm-Inspiron-N4050:~/.config$ 

或者是(17条消息) ubuntu18.04安装vscode打不开_wanttifa的博客-CSDN博客_ubuntu vscode打不开

cd ~/.config
sudo rm -rf ./Code/

后来找到一个与这个类似的(17条消息) 2020-11-09 VSCode在Ubuntu+Snap下无法启动的解决_我的博客-CSDN博客

create the modified lib
mkdir ~/lib
cp /usr/lib/x86_64-linux-gnu/libxcb.so.1 ~/lib
sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' ~/lib/libxcb.so.1
export LD_LIBRARY_PATH=$HOME/lib code #don't know if that's still necessary

unmount the snap so it can be modified and copy the modified lib into /usr/share/code/ --> then rebuild the snap and copy it back to its original location
sudo umount /snap/code/21
sudo unsquashfs /var/lib/snapd/snaps/code_21.snap
sudo cp '/home/ubuntu/lib/libxcb.so.1' /home/ubuntu/squashfs-root/usr/share/code/
sudo mksquashfs squashfs-root code_21.snap
sudo cp code_21.snap /var/lib/snapd/snaps/code_21.snap
sudo mount -t squashfs -o ro,nodev,relatime,x-gdu.hide /var/lib/snapd/snaps/code_21.snap /snap/code/21

 

但我看到 里面/lib是x86的,我搜gnu一时没搜出来,是我呆了,我后来搜libxcb.so.1就有了,也就是说,如果是arm的架构,请用下列代码

mkdir ~/lib
cd ~/lib
cp /usr/lib/arm-linux-gnueabihf/libxcb.so.1 ~/lib
sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' ~/lib/libxcb.so.1
export LD_LIBRARY_PATH=$HOME/lib code

然后vscode就能正常启动了。 

如果系统版本不一样,或者显示 not found ,推荐直接 whereis 命令找这个libxcb.so.1文件

 

你可能感兴趣的:(调机手册,vscode,ubuntu)