如何在 debian 9 上安装 VSCODE?没有任何作用

How to install VSCODE on debian 9? Nothing works

我正在尝试安装 Visual studio 代码。

我的树莓派。版本是:

分销商 ID:Raspbian

描述:Raspbian GNU/Linux 9.8(拉伸)

版本:9.8

代号:stretch

我尝试了几种方法(star 下载 .deb 并使用 dpkg 或安装命令)但没有任何效果。

我该如何解决这个问题?我真的需要 VSC,因为我的项目正在发展,而 Geany 搞砸了。

从官方网站下载了 .deb 和 .tar 文件,按照设置说明进行操作,但出现此错误

使用 dpkg(32 位和 64 位):

"package architecture (amd64) does not match system (armhf)"

"package architecture (i386) does not match system (armhf)"

使用 sudo 安装:

sudo apt install ./code_1.33.1-1554971066_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'code:amd64' instead of './code_1.33.1-1554971066_amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 code:amd64 : Depends: libnotify4:amd64 but it is not installable
              Depends: libnss3:amd64 (>= 2:3.26) but it is not installable
              Depends: apt:amd64 but it is not installable
              Depends: libxkbfile1:amd64 but it is not installable
              Depends: libsecret-1-0:amd64 but it is not installable
              Depends: libgtk-3-0:amd64 (>= 3.10.0) but it is not installable
              Depends: libxss1:amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.

有存储库:

pi@raspberrypi:~/Downloads $ sudo apt-get update
Err:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
  Temporary failure resolving 'raspbian.raspberrypi.org'
Err:2 http://archive.raspberrypi.org/debian stretch InRelease
  Temporary failure resolving 'archive.raspberrypi.org'
Err:3 https://packages.microsoft.com/repos/vscode stable InRelease
  Could not resolve host: packages.microsoft.com
Reading package lists... Done
W: Failed to fetch http://raspbian.raspberrypi.org/raspbian/dists/stretch/InRelease  Temporary failure resolving 'raspbian.raspberrypi.org'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/stretch/InRelease  Temporary failure resolving 'archive.raspberrypi.org'
W: Failed to fetch https://packages.microsoft.com/repos/vscode/dists/stable/InRelease  Could not resolve host: packages.microsoft.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
pi@raspberrypi:~/Downloads $ sudo apt-get install code
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package code

我对这个问题很生气,我尝试了旧的存储库,但它们不起作用。

Community builds of Visual Studio Code 可用(对于 Raspberry Pi 和其他 ARM 和 Intel 系统)。

这些包目前以 DEB 和 RPM 格式提供。您可以使用提供的脚本 here 来安装软件包并将它们的存储库添加到您的系统或手动安装。

下面我总结了步骤:


Open a new terminal. If you need super-user rights (you probably do), then you can enter sudo -s and press return to enter a super-user session. Run the installer for your current distribution:

APT instructions

(including Debian, Raspbian, Ubuntu and Linux Mint)

. <( wget -O - https://code.headmelted.com/installers/apt.sh )

Press the return key. Once the installer has completed, you should have a "Code - OSS" entry in your desktop program list.

Manual installation

If for any reason the script above will not work on your system, or you do not want to add the package source for updates, you can get the latest version of the package for your system below.

Public GPG key

For either APT or YUM installation, you'll want the public GPG key to verify the package, which you can download here.

APT and YUM packages

The latest packages are available directly from the PackageCloud releases page.

您需要的特定软件包可用here


编辑:

此时 (29.04.2019) 当前版本 (v. 1.32) 似乎对每个人都有效。参见:issue#64. Seems that you'll have to go back to v. 1.29,据报道 运行 正常。

您可以选择this package并手动安装,或使用APT。如果您决定通过 APT 安装它,请注意您必须如下所述标记包 on hold

要防止 code-oss 升级(以便您可以保留 v.1.29 直到问题得到解决),请遵循 these instructions

Install v. 1.29 via APT:

apt-get install code-oss=1.29.0-1539702286

Then mark it on hold by running:

apt-mark hold code-oss

Now running apt-get upgrade won't try to bump it up until you run:

apt-mark unhold code-oss

This will allow it to upgrade again as usual.