3

I am using Ubuntu 18.04, and I need to install Visual Studio Code in my machine i tried:

sudo snap install --classic vscode

but it didn't work.

Pablo Bianchi
  • 15,657
user10925558
  • 33
  • 1
  • 3

3 Answers3

4

To install Visual Studio Code Ubuntu 18.04, ust press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt update
sudo apt install software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt install code

Source.

Pablo Bianchi
  • 15,657
Mitch
  • 107,631
  • Better way now is from the DEB that adds the correct apt-key per version .. see https://askubuntu.com/a/616082/165511 – tgkprog Sep 01 '20 at 19:27
0

In addition to Mitch's answer:

If you are not best friends with your shell (yet), you can also just visit Visual Studio Code home page and click on their download link.

When downloaded, you can double-click the .deb file which will open the Ubuntu Software Center and let you install vscode using a graphical interface.

Pablo Bianchi
  • 15,657
oliverjkb
  • 236
  • 1
  • 7
0

After 18.04 version, the following one-line terminal code works well.

sudo snap install code --classic
Pablo Bianchi
  • 15,657