download visual studio code in ubuntu code example

Example 1: install vscode for ubuntu

sudo snap install --classic code

Example 2: how to install visual studio code in ubuntu

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

Example 3: vscode installation ubuntu

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg

Example 4: how to install visual studio code in ubuntu

sudo apt updatesudo apt install software-properties-common apt-transport-https wget