20.04Ubuntu搭建Vscode

1、以 sudo 用户身份运行下面的命令,更新软件包索引,并且安装依赖软件:

复制代码
sudo apt update
sudo apt install software-properties-common apt-transport-https wget

2、使用 wget 命令插入 Microsoft GPG key :

复制代码
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

3、启用 Visual Studio Code 源仓库,输入:

复制代码
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

4、安装 Visual Studio Code 软件包:

复制代码
sudo apt install code

5、当一个新版本被发布时,你可以通过你的桌面标准软件工具,或者在你的终端运行命令,来升级 Visual Studio Code 软件包:

复制代码
sudo apt update
sudo apt upgrade

启动 Visual Studio Code

如果遇到以下问题,记得要先退出sudo再运行

You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.

cd路径到你想打开的文件夹,输入code .

(注意有个. )

相关推荐
浅时光_c1 小时前
3 shell脚本编程
linux·开发语言·bash
Lucis__2 小时前
一文读懂TCP通信机制:基于相关API构建可靠性连接
linux·网络·tcp/ip
_深海凉_2 小时前
LeetCode热题100-有效的括号
linux·算法·leetcode
RNEA ESIO4 小时前
PHP进阶-在Ubuntu上搭建LAMP环境教程
开发语言·ubuntu·php
零号全栈寒江独钓4 小时前
基于c/c++实现linux/windows跨平台获取ntp网络时间戳
linux·c语言·c++·windows
左手厨刀右手茼蒿4 小时前
Linux 内核中的进程管理:从创建到终止
linux·嵌入式·系统内核
geinvse_seg4 小时前
中小团队如何低成本搭建项目管理系统?基于 Ubuntu 的 Dootask 私有化部署实战
linux·运维·ubuntu
CSCN新手听安4 小时前
【linux】高级IO,以ET模式运行的epoll版本的TCP服务器实现reactor反应堆
linux·运维·服务器·c++·高级io·epoll·reactor反应堆
丶伯爵式4 小时前
Ubuntu 24.04 更换国内软件源指南 | 2026年3月26日
linux·运维·ubuntu·国内源·升级
左手厨刀右手茼蒿4 小时前
Linux 内核中的 DMA 管理:从缓冲区到传输
linux·嵌入式·系统内核