如何在 Debian 上安装 Visual Studio Code (VS Code)
<p><span class="words-blog hl-git-1" data-tit="Visual" data-pretit="visual">Visual Studio Code 简称 VS Code 是 Microsoft 开发的免费开源跨平台<span class="edu-hl hl hl-1" data-report-click="{"spm":"1001.2101.3001.7020","extra":"{\"word\":\"代码编辑器\"}"}" data-tit="代码编辑器" data-pretit="代码编辑器">代码编辑器。 它具有内置的调试支持,嵌入式 Git 控件,语法高亮,代码完成,集成终端,代码重构和代码片段。 可以使用扩展来扩展 Visual Studio 代码功能。</span></span></p><p>本教程介绍如何在 Debian 系统上使用 apt 命令通过<span class="edu-hl hl hl-1" data-report-click="{"spm":"1001.2101.3001.7020","extra":"{\"word\":\"软件\"}"}" data-tit="软件" data-pretit="软件">软件源安装 VS Code 代码编辑器。</span></p>
<h3>提要</h3>
<p>如果遇到权限问题,在拒绝执行的命令前添加“sudo”前缀,回车后输入root用户的密码即可执行。</p>
<h3>在Debian上安装VS Code</h3>
<p>在你的Debian <span class="words-blog hl-git-1" data-tit="linux" data-pretit="linux">linux操作系统上通过以下步骤来完成 VS Code 的安装。</span></p>
<p>01、首先输入以下内容来更新软件包索引并安装依赖项:</p>
<pre class="set-code-show prettyprint" data-index="0"><code class="prism language-bash has-numbering" style="position: unset"><span class="token function">sudo apt update
<span class="token function">sudo apt <span class="token function">install software-properties-common apt-transport-https <span class="token function">curl
</span></span></span></span></code></pre>
<ul class="pre-numbering">
<li style="color: rgba(153, 153, 153, 1)">1</li>
<li style="color: rgba(153, 153, 153, 1)">2</li>
</ul>
<p>02、使用以下<span class="words-blog hl-git-1" data-tit="curl命令" data-pretit="curl命令">curl命令导入Microsoft GPG密钥:</span></p>
<pre class="set-code-show prettyprint" data-index="1"><code class="prism language-bash has-numbering" style="position: unset"><span class="token function">curl -sSL https://packages.microsoft.com/keys/microsoft.asc <span class="token operator">| <span class="token function">sudo apt-key add -
</span></span></span></code></pre>
<ul class="pre-numbering">
<li style="color: rgba(153, 153, 153, 1)">1</li>
</ul>
<p>将Visual Studio代码存储库添加到你的系统:</p>
<pre class="set-code-show prettyprint" data-index="2"><code class="prism language-bash has-numbering" style="position: unset"><span class="token function">sudo add-apt-repository <span class="token string">"deb https://packages.microsoft.com/repos/vscode stable main"
</span></span></code></pre>
<ul class="pre-numbering">
<li style="color: rgba(153, 153, 153, 1)">1</li>
</ul>
<p>03、添加存储库后,安装最新版本的Visual Studio代码:</p>
<pre class="set-code-show prettyprint" data-index="3"><code class="prism language-bash has-numbering" style="position: unset"><span class="token function">sudo apt update
<span class="token function">sudo apt <span class="token function">install code
</span></span></span></code></pre>
<ul class="pre-numbering">
<li style="color: rgba(153, 153, 153, 1)">1</li>
<li style="color: rgba(153, 153, 153, 1)">2</li>
</ul>
<p>至此, Visual Studio Code已安装在你的 Debian linux操作系统上了,你可以开始使用它。</p>
<h3>启动 VS Code 代码编辑器</h3>
<p>一旦在 Debian 系统上安装了 VS Code,您就可以通过键入代码或单击 VS Code 图标(Activities - > Visual Studio Code)从命令行启动它。</p>
<p>当您第一次启动 VS Code 时,将显示如下所示的窗口:</p>
<p><img src="https://i-blog.csdnimg.cn/blog_migrate/7295d9af940dbc29c73fd697e3bdb1e2.png" alt="在这里插入图片描述"></p>
<p>你现在可以根据自己的喜好开始安装扩展和配置VS代码。</p>
<h3>如何更新 VS Code</h3>
<p>发布新版本的 Visual Studio Code 时,您可以通过桌面标准软件更新工具或在终端中运行以下命令来更新软件包:</p>
<pre class="set-code-show prettyprint" data-index="4"><code class="prism language-bash has-numbering" style="position: unset"><span class="token function">sudo apt update
<span class="token function">sudo apt upgrade
</span></span></code></pre>
<ul class="pre-numbering">
<li style="color: rgba(153, 153, 153, 1)">1</li>
<li style="color: rgba(153, 153, 153, 1)">2</li>
</ul>
<h3>总结</h3>
<p>你已在 Debian 9 计算机上成功安装了 VS Code。 您的下一步可能是安装其他组件并自定义您的用户和工作区设置。</p><br><br>
来源:https://www.cnblogs.com/maijin/p/18798439
頁:
[1]