Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»IDE»How to Install Visual Studio Code in Ubuntu & Debian

    How to Install Visual Studio Code in Ubuntu & Debian

    By RahulJune 18, 20213 Mins Read

    Visual Studio Code is a lightweight source code editor for JavaScript, TypeScript and Node.js Applications. It also has extensions for multiple other programming languages like C++, C#, Python, PHP, Go, etc. This tutorial will help you to install Visual Studio Code editor on Ubuntu, Debian, Linuxmint, and its derivatives systems.

    Advertisement
    • How to Install Mono Framework on Ubuntu

    This tutorial covers two methods for install VS Code on Ubuntu, Debian, and Linux Mint systems.

    How to Install VS Code on Ubuntu using Snap

    The Visual Studio Code is officially distributed as a Snap package in the Snap Store. Also, most of the latest operating systems recommended using the Snap tool for the packages installation. With these instructions, you can install Visual Studio Code on Ubuntu, Debian, and Linux Mint systems along with its derivatives.

    To install VS Code, Open a terminal (CTRL+ALT+T) and type:

    sudo snap install code --classic 
    

    On successful completion of the above command, the VS code will be installed on your Debian-based system.

    Alternatively, follow the next method to install Visual studio code.

    How to Install VS Code on Ubuntu using PPA

    Use the following instructions to install Visual Studio Code on Ubuntu, Debian and Linux Mint systems using Debian packages. The PPA is officially maintained by Microsoft.

    Step 1. First of all, You need to enable a package repository in your system. Run the following command to enable Visual studio code repository to your system.

    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' 
    

    Step 2. Next, Import the package signing gpg key on your system using the following command.

    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/
    

    Step 3. After importing gpg key, Let’s use the below commands to install Visual Studio Code on your Debian-based system.

    sudo apt-get update
    sudo apt-get install code
    

    That’s it. You have successfully installed Visual Studio code on a Linux system.

    Working with Visual Studio Code

    Now launch the Visual Studio Code editor on your system using the graphical menu. After that create a new file or open files and directories using the File menu.

    Visual Studio Code Editor

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

    Visual Studio Code Editor

    Conclusion

    In this tutorial, you have learned two methods for installing Visual Studio Code on a Debian-based Linux system.

    code editor editor IDE visual studio code
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Copy and Paste Content in Vi or Vim Editor

    Format Source Code in Visual Studio Code

    How to format source code in Visual Studio Code (VSCode)

    How to Install VS Code on Ubuntu 22.04

    How to Install Visual Studio Code on Ubuntu 22.04

    View 12 Comments

    12 Comments

    1. KernelTerror on July 26, 2021 2:25 am

      I think maybe you should not be adding the key to trusted.gpg.d anymore. From a askubuntu post:
      “the actual problem that led to apt-key add being deprecated. The problem is not a question of appending a key to one big keyring file etc/apt/trusted.gpg vs manually putting single-key keyring files into the directory /etc/apt/trusted.gpg.d/. These two things are equivalent, and doing either one is a huge security risk.”
      …
      “do not add it to apt’s trusted keystore by copying it into /etc/apt/trusted.gpg.d/. Instead, put it somewhere like /usr/local/share/keyrings/. (You’ll need to create that keyrings directory first.) There’s nothing special about that location, it’s just convention that /usr/local is for stuff that’s specific to this machine, share because it’s not a binary or a library or specific to any given user, and keyrings is just a descriptive name …then edit your sources to have the appropriate signed-by= path”
      https://askubuntu.com/questions/1286545/what-commands-exactly-should-replace-the-deprecated-apt-key

      Reply
    2. Abby on June 17, 2021 1:06 pm

      The code package doesn’t exist, apparently

      Reply
      • Rahul on June 18, 2021 2:04 am

        On which OS version are you trying to install?

        Reply
    3. armel sanou on August 2, 2019 12:38 pm

      Very good thanks.

      Reply
    4. Mariappan on April 16, 2019 2:13 am

      I am getting this error

      [email protected]:/etc/apt/sources.list.d$ sudo curl https://packages.microsoft.com/keys/microsoft.asc | gpg –dearmor > microsoft.gpg
      bash: microsoft.gpg: Permission denied
      % Total % Received % Xferd Average Speed Time Time Time Current
      Dload Upload Total Spent Left Speed
      100 983 100 983 0 0 3824 0 –:–:– –:–:– –:–:– 3810
      (23) Failed writing body

      Reply
      • Gudbro on August 3, 2019 7:43 pm

        Thank you.

        Reply
    5. Pavan on April 11, 2019 6:02 am

      good….!!!

      Reply
    6. Venkatesh on April 3, 2019 12:54 pm

      We don’t have permission to create a file in that specified directory /etc/apt/sources.list.d/

      Reply
    7. Dot Net on December 7, 2018 7:07 am

      I am obliged for this article Rahul, I was trying to download visual studio in ubuntu for office work. I am glad I reached your article in perfect time. It helped me to do it in easy way.

      Reply
    8. Sanjay on November 25, 2018 4:54 pm

      Strangely there are no literature or documents found on step by step VS code installation on an Ubuntu server (AWS EC2 server) through the command line (ssh interface). The closest I got was this website. Rahul – can you please confirm these are the right set of instructions to insall VS code on an Ubuntu EC2 server through ssh ?

      1. Create a new file /etc/apt/sources.list.d/vscode.list
      2. Add a new line deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
      3. Run the following 4 commands

      curl https://packages.microsoft.com/keys/microsoft.asc | gpg –dearmor > microsoft.gpg
      sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
      udo apt-get update
      sudo apt-get install code

      Usually, ubuntu package installation is straightforward using apt install. This looks like a bit of a drain. Any reasons for the long drawn process assuming this is the correct process?

      Reply
    9. sumit dhar on November 24, 2017 8:11 am

      i was installing visual studio but it is showing error”E: ailed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry ‘main/binary-i386/Packages’ in Release file (Wrong sources.list entry or malformed file)

      E: Some index files failed to download. They have been ignored, or old ones used instead.”

      Reply
      • Rahul K. on November 26, 2017 7:54 am

        This is Google chrome deb repository, which is showing this error. Just remove entry for chrome repository.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    • sleep Command in Linux with Examples
    • 20 Basic Linux Commands for the Beginners (Recommended)
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.