Yogesh patel
Yogesh patel

Reputation: 1371

How to install Visual Studio Code on Linux?

I have just downloaded VSCode-linux-x64 from the Microsoft website. It's a zip file called VSCode-linux-x64.zip. How can I install it on my Linux system?

Upvotes: 7

Views: 49607

Answers (6)

Omkesh Sajjanwar
Omkesh Sajjanwar

Reputation: 843

For Linux (Ubuntu 22.04.2 LTS) by terminal

  1. Update the system

sudo apt update && sudo apt upgrade -y

  1. Install packages

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

  1. Import repository

wget -O- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg

echo deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main | sudo tee /etc/apt/sources.list.d/vscode.list

  1. Update the system again

sudo apt update

  1. Install the VS-Code

sudo apt install code

Upvotes: -1

Shaurya Mehta
Shaurya Mehta

Reputation: 82

Simplest way to install Visual Studio Code in Linux I hope it useful. Installing Visual Studio Code in Kali Linux - 4 simple steps

  1. Update your system and install the below package.
    sudo apt update
    sudo apt install curl gpg software-properties-common apt-transport-https
    
  2. Importing Microsoft GPG key to Kali Linux
    curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    
  3. Adding APT repository for VS Code to Kali Linux
     echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
    
  4. Installing VS Code
    sudo apt update
    sudo apt install code
    

For reference: https://youtu.be/ycIjQf0rOJI

Upvotes: -1

Fellipe Sanches
Fellipe Sanches

Reputation: 8135

Installing with apt-get:

Step 1 – Enable Package Repository

Run the following command to enable Visual studio code repository to your system:

echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" | sudo \ tee /etc/apt/sources.list.d/vs-code.list

Step 2 – Install Visual Studio Code Editor

Now, Import the package signing gpg key on your system using the following command:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

Install Visual Studio Code on your Debian based system (like Ubuntu):

sudo apt-get update
sudo apt-get install code

Step 3 – Launch Visual Studio Code and enable its extensions:

Now You can launch the Visual Studio Code editor on your system using the graphical menu.

enter image description here

There are a large number of extensions available for Visual Studio Code like PHP, Python, JavaScript etc. Install the required extensions to enhance your working experience with Visual Studio Code.

enter image description here

Source: https://tecadmin.net/install-visual-studio-code-editor-ubuntu/

Upvotes: 2

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

sudo snap install code --classic

Upvotes: 1

Yogesh patel
Yogesh patel

Reputation: 1371

I found the answer to my question and posting the answer so it can help others. To download and install Visual Studio Code on Ubuntu . follow the steps below

  • Download Visual Studio Code for Linux

  • Extract the zip file VSCode-linux-x64.zip

  • Go inside the folder VSCode-linux-x64

  • double click and Run code executable to open Visual Studio Code .

  • You can right click on Visual Studio Code on toolbar (or launcher)
    and select Lock to Launcher. this way you can launch the editor by
    clicking it on launcher.

If you are using terminal follow the terminal commands

  • mkdir your_folder_name && cd your_folder_name unzip
  • ../Downloads/VSCode-linux-x64.zip
  • ./Code

This video will help you to download and install and use Visual Studio Code on Ubuntu if you still have some doubts

Upvotes: 2

ChiefTwoPencils
ChiefTwoPencils

Reputation: 13930

From a few pages deeper into the setup docs in the link you offered...

Linux

  1. Download Visual Studio Code for Linux
  2. Make a new folder and extract VSCode-linux-x64.zip inside that folder
  3. Double click on Code to run Visual Studio Code

Tip: If you want to run VSCode from the terminal, create the following link substituting /path/to/vscode/Code with the absolute path to the Code executable
sudo ln -s /path/to/vscode/Code /usr/local/bin/code in any folder to start editing files in that folder.

Now, you can simply type code . in any folder to start editing files in that folder.

Upvotes: 5

Related Questions