Or copy link
Copy link
Visual Studio Code (VS Code) is a widely used code editor developed by Microsoft that supports several programming languages. It provides features such as syntax highlighting, debugging, and version control, making it suitable for various development needs. Being open source, it is freely available for download and installation.
One of its key advantages is its cross-platform compatibility, allowing installation on all major operating systems, including Linux, Windows, and macOS. In this tutorial, we will demonstrate how to install VSCode in Linux.
You can use the apt package manager to install Visual Studio Code on Debian-based Linux distributions like Debian, Ubuntu, and Linux Mint. You can go through the below-listed step-by-step guidelines to install VS Code on Debian-based systems:
Before you install VSCode, update your system’s package list by running the command:
sudo apt update
To avoid compatibility issues, it is recommended to check the Linux version before installing any software, such as VS Code.
Let’s run the below command to install the necessary packages like apt-transport-https and software-properties-common:
sudo apt install software-properties-common apt-transport-https
To download VSCode in Linux, download the Microsoft GPG key using the wget command, and convert it into a valid format that can be stored and used by apt:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
Read also How to Install Graphical Uncomplicated Firewall on Ubuntu
After this, install the Microsoft GPG key to a trusted directory like /etc/apt/trusted.gpg.d/. Here, we use the o, g, and options to make sure the appropriate ownership and file permissions for the key:
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
Now we are all set to add the Visual Studio Code repository to our system:
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
After importing the VSCode repository, update the system by executing the below-given command to refresh the package lists:
Finally, we are all set to install VSCode on Linux:
sudo apt install code
After installation, we can access the Visual Studio Code from the application manager and use it to fulfill our coding needs:
To install VS Code on RedHat-based systems like CentOS, RHEL, and Fedora, you can use the dnf package manager. Follow the steps outlined below to proceed with the VS Code installation:
Before installing VSCode, refresh your system’s package list with the following command:
sudo dnf update
Next, use the rpm command to import the Microsoft GPG key to your system:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
After importing the Microsoft GPG key, create a repository file for Visual Studio Code using the following command:
sudo vim /etc/yum.repos.d/vstudio_code.repo
Then paste the following script into the repository file to configure the Visual Studio Code repository:
name=Visual Studio Code baseurl=https://packages.microsoft.com/yumrepos/vscode enabled=1 gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc
Finally, run the command below to install Visual Studio code on your Linux system:
sudo dnf install code
Install VS Code on our Best Linux VPS!
Install VS Code seamlessly on our best Linux VPS. Enjoy fast performance, easy setup, and full control over your development environment!
To install Visual Studio Code on Linux using Flatpak, start by setting up Flatpak and adding the Flathub repository. After that, install Visual Studio Code from Flathub to get the latest version, which works well across different Linux systems.
Let’s run the below-given command to add the Flathub repository to your system if it doesn't already exist:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
After adding the Flathub repository, execute the command below to install VS code on Linux using Flatpak:
flatpak install flathub com.visualstudio.code
Once VS Code is installed via Flatpak, you can launch VS Code and begin working on your coding projects in Linux:
That’s all about installing and using Visual Studio Code on Linux.
Visual Studio Code (VS Code) is an easy-to-use code editor for developers. It supports multiple programming languages and offers useful features like syntax highlighting, debugging, and version control. We can install and use Visual Studio code on all major operating systems. In this article, we provided simple steps to install VS Code on different Linux distributions, including Debian-based and RedHat-based systems.
We hope this guide has helped you successfully install VS Code on Linux. For a faster and smoother coding experience, consider using Ultahost's fast VPS hosting. With dedicated resources and instant access, Ultahost ensures reliable performance for even the most demanding development tasks.
Visual Studio Code is a popular code editor developed by Microsoft that supports multiple programming languages and offers features like syntax highlighting, debugging, and version control.
Yes, VS Code is open source and available for free download and installation.
Yes, VS Code is cross-platform and can be installed on major operating systems, including Linux, Windows, and macOS.
You can use the apt package manager to install VS Code on Debian-based distributions like Debian, Ubuntu, and Linux Mint.
For RedHat-based systems like CentOS, RHEL, and Fedora, you can use the dnf package manager to install VS Code.
Yes, for Debian-based distributions, you may need to install packages like apt-transport-https and software-properties-common before installing VS Code.
After installation, you can access Visual Studio Code from your application manager or by running the command code in the terminal.
Plesk is a comprehensive web hosting control panel desi...
Adding an SSH key to Visual Studio Code (VS Code) is a ...
Efficiently managing file systems is crucial in Linux. ...
Git is an important tool on Ubuntu for both development...
The .deb packages are the standard format for installin...
The Nohup command, which stands for "no hang up," is a ...
Save my name, email, and website in this browser for the next time I comment.
Δ