Table of Contents
- Install Visual Studio Code as snap
- Installing Visual Studio Code from apt
- Install Visual Studio Code DEB package
- Conclusion
Visual Studio Code is an open-source, cross-platform code editor. Developed and maintained by Microsoft. Visual Studio Code works with many built-in features like debugging, Git support, syntax highlight, snippets and other valuable third-party extensions. Hence, It gives the developer complete freedom to customise work experience and provide a remarkably fast workflow for programmers. So let’s install VSCode on Ubuntu 20.04. Also, we covered different installation methods like Install Visual Studio Code as snap, Install Visual Studio Code from apt and Install Visual Studio Code DEB package.
Install Visual Studio Code as snap
Visual Studio Code is available in the Ubuntu Snap package manager, which is one of the fastest ways to install it. So if you are working with Ubuntu 16.04 LTS or later then snap is already installed. For other Ubuntu, versions execute the following commands to install a snap. ( Upgrade Ubuntu to 20.04 LTS )
$ sudo apt-get update
$ sudo apt-get install snapd
$ snap version
Snap will install some extra packages and/or upgrade packages. When everything has finished, you need to reboot the system.
We can install it from either the command line or via Ubuntu Software Application. Therefore let’s command line first to install Visual Studio Code.
$ sudo snap install --classic code
Now let’s check how can install Visual Studio Code using GUI. For that open Ubuntu Software OR Snap Store and search Visual Studio Code and click Install. It will also upgrade Visual Studio in the background, whenever a new version is released.
Installing Visual Studio Code from apt
Let’s check how we will going to install Visual Studio Code from official apt repositories. So we will learn how you can install the repository and key manually by executing the following scripts.
$ 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/
$ sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Once the repository and key are installed successfully, update the package and install Visual Studio Code using
$ sudo apt-get install apt-transport-https
$ sudo apt-get update
$ sudo apt-get install code
Install Visual Studio Code DEB package
This is a standard way to install Visual Studio. VSCode is also officially available as a DEB package for Debian / Ubuntu distro.
Firstly download the deb package from Visual Studio Code Download and use the apt / dpkg command to install it.
If you are using a Linux distribution based on Ubuntu, like Linux Mint, Elementary OS and many more, then you need to download the .deb package. For OS like Fedora or SUSE-based distribution download .rpm packages. Once downloaded, execute the following commands from the file ( Downloaded ) location.
$ sudo dpkg -i visualstudiofilename.deb
$ sudo apt-get install -f *This command tries to fix any broken packages by installing missing dependencies.*
OR
$ sudo apt install ./visualstudiofilename.deb
Conclusion
Visual Studio is lightweight and should work on almost all available hardware and platforms. Visual Studio releases a new version every month to introduce new features and bug fixes. Generally, the platform promoted the installation of the new release. Now you can install the extensions as per your work requirement.