-
添加apt源到/etc/apt/sources.list文件
$ sudo echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" >> /etc/apt/sources.list
-
添加gpg公钥
$ sudo curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg
-
如果提示找不到curl执行命令,请先安装curl
$ sudo apt install curl
-
执行更新
$ sudo apt update
-
安装vscode
$ sudo apt install code
这样就可以通过apt命令对vscode进行更新了。
以上~