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.
- Launch the Ubuntu search experience with the Start button on your keyboard.
- Search for Ubuntu Software.
- Click the top result and launch the app.
- In the search bar on the top left, search for VScode.
- Click the top result for Code.
- Click the Install button.
- If prompted, enter your password.
- 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.
- Launch a terminal session.
- Install VS Code:
sudo snap install --classic code
- Enter your password.
- Allow the app to download
- 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.
- Launch a terminal session.
- Update your repository:
sudo apt update
- Enter your password.
- Install wget and gpg:
sudo apt-get install wget gpg
- Install the dependencies for VS Code:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor> packages.microsoft.gpg
- Enter your password.
- Install the package:
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
- Enter your password.
- 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'
- Enter your password.
- Run the command:
rm -f packages.microsoft.gpg
- Run the command:
sudo apt install apt-transport-https -y
- 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.