Centos7.x 安装VsCode

本文记录了在CentOS系统中通过命令行安装Visual Studio Code的步骤,包括添加微软官方YUM源、更新软件包并安装,以及解决超级用户启动问题的解决方案。附带官方安装链接和常见问题指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

缘起

记录Centos安装VsCode的过程,好记性不如烂笔头

安装步骤

安装软件

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
sudo yum install code

在命令终端以普通用户输入如下code,即可启动软件
在这里插入图片描述

常见问题

  1. 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.
    解决方案:以普通用户执行程序

参考资料

  1. 官方安装教程:传送门
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值