CentOS Stream 9 安装VSCode

提示:本教程适用于centos与redhat enterprise linux的vscode安装

一、VSCode是什么?

VSCode(全称:Visual Studio Code)是一款由微软开发且跨平台的免费源代码编辑器。该软件支持语法高亮、代码自动补全(又称 IntelliSense)、代码重构、查看定义功能,并且内置了命令行工具和 Git 版本控制系统。用户可以更改主题和键盘快捷方式实现个性化设置,也可以通过内置的扩展程序商店安装扩展以拓展软件功能。

二、安装步骤

1.切换至root用户,导入微软GPG密钥

[centos@centos ~]$ su root
密码: 
2.导入微软GPG密钥
[root@centos centos]# sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

2.安装

[root@centos centos]# 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'
[root@centos centos]# code
bash: code: command not found...
Install package 'code' to provide command 'code'? [N/y] y


 * Waiting in queue... 
 * Loading list of packages.... 
The following packages have to be installed:
 code-1.70.0-1659589373.el7.x86_64    Code editing. Redefined.
Proceed with changes? [N/y] y


 * Waiting in queue... 
 * Waiting for authentication... 
 * Waiting in queue... 
 * Loading list of packages.... 
 * Downloading packages... 


 * Requesting data... 
 * Testing changes... 
 * Installing packages... 
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.


总结

以上就是今天要讲的内容,本文仅仅简单介绍了vscode的安装,安装成功后即可在桌面找到vscode了

猜你喜欢

转载自blog.csdn.net/m0_53649704/article/details/126172577