首页 > 系统相关 >温故知新,从VSCode安装了解Debian/Ubuntu下安装

温故知新,从VSCode安装了解Debian/Ubuntu下安装

时间:2022-08-18 14:33:26浏览次数:79  
标签:VSCode 温故知新 gpg apt install packages 安装 microsoft

image

谈安装

原文

The easiest way to install Visual Studio Code for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit), either through the graphical software center if it's available, or through the command line with:

为基于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 # Install dependencies

解析

首先针对Debian/Ubuntu系统,VSCode给了一个64位的Deb包,名称是code_1.70.2-1660629410_amd64.deb,这里code是VSCode产品名称,1.70.2是程序版本号,1660629410估计是一个编译号,amd64代表x86_x64

接下来,从安装命令来看,它优先推荐使用apt来安装。

并且备注如果使用较老版本的Linux分支,可以使用dpkg或者apt-get来替代。

说明,在最新的系统版本中,已经更推荐apt方式了。

谈证书

原文

Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the system's package manager. Alternatively, the repository and key can also be installed manually with the following script:

安装.deb包会自动安装apt仓库和签名密钥,以便使用系统的软件包管理器实现自动更新。另外,仓库和密钥也可以用下面的脚本手动安装。

sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg

解析

这一步,先引导安装wgetgpg这两个组件。

然后通过wget把微软的asc拉下来,并转成gpg,存储为packages.microsoft.gpg

然后安装packages.microsoft.gpg/etc/apt/keyrings/packages.microsoft.gpg

接下来将一段签名配置写入到/etc/apt/sources.list.d/vscode.list这个配置中。

最后清理掉packages.microsoft.gpg

谈更新

原文

Then update the package cache and install the package using:

然后更新软件包的缓存,并使用安装软件包。

sudo apt install apt-transport-https
sudo apt update
sudo apt install code # or code-insiders

解析

先安装apt对https的一个支持组件apt-transport-https

然后更新一下apt的索引。

接着就是通过apt来安装代号为code的软件。

参考

标签:VSCode,温故知新,gpg,apt,install,packages,安装,microsoft
From: https://www.cnblogs.com/taylorshi/p/16598601.html

相关文章

  • VSCode搭建Rust开发环境
    前言本文以WindowsVSCode+WSL搭建为例。搭建步骤1、安装WSL。2、在WSL中安装c/c++编译环境(Rust依赖gcc):aptinstallbuild-essential运行此命令会自动安装gcc,g+......
  • vscode command 'c_cpp.configuration edit json' not found 解决办法
    实际测试有效,解决方法如下:Ithinkit'sallabout IntelliSense for C_Cpp.AfterIre-enabledC_CppIntelliSense, gotodefinition worksagain...Lookslike......
  • 【快应用】车机加载器安装失败
    ​【问题背景】在车机模拟器上安装加载器失败,报错: ​ 【解决方法】请按照如下步骤检查:1、  adbdevices检查模拟器是否开启,需要开启模拟器2、  如果模拟器已......
  • JDK 1.8安装
    JDK1.8安装shell脚本安装cd/usr/local/wgethttps://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gztar-xfjdk-8u201-linux-x64.tar.gzln......
  • 离线安装文件
    PIP3#所有依赖库导成txtpip3freeze>requirements.txt#下载依赖到packages文件夹下download-dpackages-rrequirements.txt--trusted-hostmirrors.cloud.ali......
  • 【pip】pip3安装BeautifulSoup
    1、pipinstallBeautifulSoup报错Lookinginindexes:https://pypi.tuna.tsinghua.edu.cn/simpleCollectingBeautifulSoupUsingcachedhttps://pypi.tuna.tsinghua......
  • 安装油猴tampermonkey脚本+Greasy Fork及使用教程
    google浏览器安装tampermonkey扩展插件下载地址:链接:https://pan.baidu.com/s/1LBRYHcdkZxfFtBKwMagcmw提取码:nu14安装开启扩展插件:GreasyFork脚本脚本下载......
  • Nginx_安装配置后,浏览器不能访问配置的站点ip:防火墙
    一、检查nginx安装成功[root@localhostsoftRyc]#/usr/local/webserver/nginx/sbin/nginx-vnginxversion:nginx/1.21.2 二、配置检查成功[root@localhostconf]#......
  • conda安装报错:PermissionError [Errno 13] Permission denied
    原文链接Anaconda创建环境,激活环境condacreate,keras安装失败:PermissionError[Errno13]PermissiondeniedAnaconda创建虚拟环境:condacreate-nmy_rootLinux......
  • 离线(无网)安装、运行arthas工具的方法
    如何在没有网的主机或者容器中,安装arthas工具? 之前的arthas,在启动的时候,都要下载一些依赖的库,必须要联网。现在,使用最新的全的arthas的包,就解决了这个问题。 接下来......