How To Install VS Code On Ubuntu

You don’t need to run Windows to use Microsoft’s Visual Studio Code (VS Code). You can install it on Ubuntu in a few steps. When it comes to app development, … Read more

Taylor Bell

Taylor Bell

Published on May 30, 2024

How To Install VS Code On Ubuntu

You don’t need to run Windows to use Microsoft’s Visual Studio Code (VS Code). You can install it on Ubuntu in a few steps.

VSCode

When it comes to app development, you have probably heard of Visual Studio Code. Often called VS Code as shorthand, this is a popular code editor used on Windows and even macOS. If you’re on one of the many great laptops that run Ubuntu Linux or an Ubuntu-powered desktop, however, you should be happy to know that you can run VS Code on your system. You can install it as a snap package, as an apt, or even through the Ubuntu Software Center or through a manual download. We will take a look at all three methods for you right here.

How to install VS Code on Ubuntu through the Software Center

The easiest way to install VS Code on Ubuntu is through the Software Center. It’s similar to the Microsoft Store on Windows, or the iOS and Android app stores. No need to dig in the terminal, or go through extra steps. Just click a few buttons, and you’ll be up and running with the app.

  1. Launch the Ubuntu search experience with the Start button on your keyboard.
  2. Search for Ubuntu Software.
  3. Click the top result and launch the app.
  4. In the search bar on the top left, search for VScode.
    VS Code in the Ubuntu software center

  5. Click the top result for Code.
  6. Click the Install button.
  7. If prompted, enter your password.
    VSCode in the Ubuntu Software Center

  8. Follow the steps on your screen for installation.

If you’re having issues finding VS Code through the Software Center, you can also download it manually. Just visit the Visual Studio Code website. From there, click Download .DEB. Once the file is downloaded, double-click to launch it and press the green Install button.

How to install VS Code as a snap package

If you prefer to install VS Code as a snap package for easy management and for self-containment, all you have to do is run the commands below. Remember, you have to press Enter after each command.

  1. Launch a terminal session.
  2. Install VS Code:
    sudo snap install --classic code
    Installing VS Code on Ubuntu

  3. Enter your password.
  4. Allow the app to download
  5. Once the download is complete, you can check for VS Code using the following command:
    code --version

How to install VS Code with apt

Finally, there’s the trickiest method of them all for installing VS Code. This one is for more technical users who are comfortable using the terminal and advanced bits of text. Here’s what to do.

  1. Launch a terminal session.
  2. Update your repository:
    sudo apt update
    Updating the repositories in Ubuntu

  3. Enter your password.
  4. Install wget and gpg:
    sudo apt-get install wget gpg
  5. Install the dependencies for VS Code:
    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor> packages.microsoft.gpg
    Installing VS Code with a command line in Ubuntu

  1. Enter your password.
  2. Install the package:
    sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
  3. Enter your password.
  4. Run the command:
    sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main"> /etc/apt/sources.list.d/vscode.list'
  5. Enter your password.
  6. Run the command:
    rm -f packages.microsoft.gpg
  7. Run the command:
    sudo apt install apt-transport-https -y
    Installing VS Code with the terminal in Ubuntu

  8. Run the command:
    sudo apt install code

Once you complete the steps above, you can verify the installation with code –version.

That’s it! You should now have VS Code installed on Ubuntu. We also suggest installing other developer tools, too, like MySQL or Java. If you decide that you want to remove the app, the steps are different for each method of installation. If you installed using the Software Center, visit the Installed section of the app and click Uninstall. If you installed using snap, use the command sudo snap remove code. Finally, if you installed using apt, use the command sudo apt remove code.

Partager cet article

Inscrivez-vous à notre newsletter