1. In Ubuntu
There are two ways that you can install vscode in your ubuntu machine.
- With snap package
- With apt
Install with snap package with bellow command in terminal:
sudo snap install –classic code
That’s it. Visual Studio Code has been installed on your Ubuntu machine.
Install with apt installer.
First, update the packages typing in terminal:
sudo apt update
Second, Install those dependency:
sudo apt install software-properties-common apt-transport-https wget
Third, Import the Microsoft GPG key using the following command:
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add –
Fourth, Enable the Visual Studio Code repository by typing:
sudo add-apt-repository “deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main”
Finally, Install the vscode:
sudo apt install code
2. In RHEL, Fedora, and CentOS based distributions
We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:
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'
Then update the package cache and install the package using dnf
(Fedora 22 and above):
sudo dnf check-update
sudo dnf install code
Installation completed happy coding with vscode.