如何在debian 9上安装VSCODE?什么都行不通

问题描述 投票:2回答:1

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

我的Raspb。版本是:

经销商ID:Raspbian

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

发布:9.8

代号:拉伸

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

我该如何解决这个问题?我真的需要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

我对这个问题感到生气,我尝试了较旧的存储库,但它们无法正常工作。

visual-studio-code vscode-settings
1个回答
1
投票

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

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

下面我总结了以下步骤:


打开一个新终端。如果您需要超级用户权限(您可能会这样做),则可以输入sudo -s并按回车键进入超级用户会话。运行当前分发的安装程序:

APT instructions

(包括Debian,Raspbian,Ubuntu和Linux Mint)

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

按返回键。安装程序完成后,您的桌面程序列表中应该有一个“代码 - OSS”条目。

Manual installation

如果由于任何原因上述脚本无法在您的系统上运行,或者您不想添加更新的软件包源,则可以在下面获取系统的最新版本软件包。

Public GPG key

对于APT或YUM安装,您需要公共GPG密钥来验证包,您可以下载here

APT and YUM packages

最新套餐可直接从PackageCloud releases page购买。

您需要的具体包装是here


EDIT:

此时(29.04.2019),当前版本(版本1.32)似乎并不适用于所有人。见:issue#64。似乎你必须go back to v. 1.29,据报道运行正常。

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

为了防止code-oss升级(这样你可以保持v.1.29,直到问题得到解决),请关注these instructions

通过APT安装v.1.29:

apt-get install code-oss=1.29.0-1539702286

然后通过运行将其标记为保持:

apt-mark hold code-oss

现在运行apt-get upgrade不会尝试碰撞它,直到你运行:

apt-mark unhold code-oss

这将允许它像往常一样再次升级。

© www.soinside.com 2019 - 2024. All rights reserved.