首页 > 解决方案 > 无法在 ubuntu 上安装 Visual Studio 代码

问题描述

在 ubuntu 上安装 Visual Studio 代码时出现此错误。

我尝试了这些命令,前三个有效,但在第四个之后出现错误。

  1. sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
  2. sudo apt-get 更新
  3. sudo apt-get install ubuntu-make
  4. umake web 视觉工作室代码

    用法:umake web [-h] {firefox-dev,phantomjs} ... umake web:错误:参数框架:无效选择:'visual-studio-code'(从'firefox-dev','phantomjs'中选择)

标签: ubuntuvisual-studio-code

解决方案


我不知道最后一个命令,根据ubuntu-makehttps://askubuntu.com/a/616363/861358它应该是这样的:

umake ide visual-studio-code

请注意,官方文档中还介绍了其他安装 Visual Studio Code 的方法:

安装

基于 Debian 和 Ubuntu 的发行版

为基于 Debian/Ubuntu 的发行版安装 Visual Studio Code 的最简单方法是通过图形软件中心(如果可用)或通过命令行下载并安装.deb 包(64 位) :

sudo apt install ./<file>.deb

# If you're on an older Linux distribution, you will need to run this instead:
# sudo dpkg -i <file>.deb
# sudo apt-get install -f 

安装依赖项安装 .deb 包将自动安装 apt 存储库和签名密钥,以使用系统的包管理器启用自动更新。请注意,下载页面上也提供 32 位和 .tar.gz 二进制文件。

也可以使用以下脚本手动安装存储库和密钥:

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
apt-get install code # or code-insiders

推荐阅读