安装密钥和存储库
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
安装VSCode
yum check-update
sudo yum install code
运行VSCode
/usr/share/code/bin/code --user-data-dir
/usr/share/code/bin/code
问题解决
问题1
/usr/share/code/code: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory
解决:
yum install libxkbcommon-x11-devel
问题2
/usr/share/code/bin/../code: /lib64/libnss3.so: version `NSS_3.22' not found (required by /usr/share/code/bin/../code)
解决
yum install nss
桌面快捷方式
在/usr/share/applications下找到vscode的图标复制到桌面
参考
[https://code.visualstudio.com/docs/setup/linux]