How to install Microsoft Visual Studio Code on Linux
Need to get your hands on Microsoft’s Visual Studio Code on Linux but unsure about how to do it? If so, this guide can help! Follow along as we go over how to set up Visual Studio Code on Linux! Ubuntu instructionsMicrosoft’s Visual Studio Code app works on Linux, including Ubuntu. To get the app working on your favorite Ubuntu-like Linux distribution, head over to the official VSC download page and grab the DEB package. Once you’ve got the DEB package downloaded to your computer, launch a terminal session and use the CD command to move from the home directory (~/) to the ~/Downloads folder.Note: Visual Studio Code is only available for the 64-bit version of Ubuntu. Sadly, there isn’t a 32-bit release, and it doesn’t appear that Microsoft will ever release one.cd ~/DownloadsIn ~/Downloads, run the dpkg command. Running this command will start the package installation on your Ubuntu PC.sudo dpkg -i code_*_amd64.debWhen the package finishes installing on your Ubuntu Linux PC, you may notice some errors. These errors don’t always happen, but when they do, you can quickly make them go away by running the apt install command with the “f” switch.sudo apt install -fAfter running the fix command, Visual Studio Code will be up and running on Ubuntu.Debian instructionsAs there is a DEB package available, Visual Studio Code will work just fine on Debian. However, if you’re a Debian user, you may need to enable the third-party software source, as it may have dependencies not found (or outdated) in the current Debian repository.To enable the software source, launch a terminal window and gain root access by running the su command.Note: Can’t use su? Sudo works instead!su -orsudo -sNow that you’ve got Root access in the terminal run the Curl command and download the release key.curl https://packages.microsoft.com/keys/microsoft.asc | gpg –dearmor > microsoft.gpgAdd the Microsoft GPG key to the Root user with the install command.install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/With the GPG key working on Debian, it’s time to add the software repository.
sh -c ‘echo “deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main” > /etc/apt/sources.list.d/vscode.list’After adding the new software source to Debian, you must install the “apt-transport-https” package to your computer. It is a required package, since Microsoft’s software repository is HTTPS, and Debian can’t handle these connections out of the box.apt-get install apt-transport-httpsThe HTTPS transport package is working within Apt/Apt-get. Now it’s time to run the “update” command.apt-get updateFinally, install Visual Studio Code on your Debian Linux PC withapt-get install codeArch Linux instructionsMicrosoft’s Visual Studio Code is available on the AUR. To install it, launch a terminal and follow the step-by-step instructions below.Step 1: Install the Base-devel and Git packages to your Arch computer.sudo pacman -S base-devel gitStep 2: Clone the Visual Studio Code AUR package with Git.git clone https://aur.archlinux.org/visual-studio-code-bin.gitStep 3: CD into the code folder.cd visual-studio-code-binStep 4: Compile the package and install it on your Arch Linux PC. Be sure to read the comments if you run into issues.makepkg -sriFedora instructionsThere’s an RPM repository for Microsoft’s Visual Code available. If you’re a Fedora user, you’ll be able to set it up. To set it up, launch a terminal window and gain root access with su.su –Now that you’ve got Root set up the Repo’s GPG key.rpm –import https://packages.microsoft.com/keys/microsoft.ascWith the key imported, it’s time enable the Repo.sh -c ‘echo -e “[code]nname=Visual Studio Codenbaseurl=https://packages.microsoft.com/yumrepos/vscodenenabled=1ngpgcheck=1ngpgkey=https://packages.microsoft.com/keys/microsoft.asc” > /etc/yum.repos.d/vscode.repo’Next, run the DNF update.sudo dnf check-updateLastly, install the program on Fedora with:sudo dnf install code -yOpenSUSE instructionsThe RPM repository works great on Fedora, but it also works on OpenSUSE. To get it working, you must import the GPG key and add the repo to your system.rpm –import https://packages.microsoft.com/keys/microsoft.asc
sh -c ‘echo -e “[code]nname=Visual Studio Codenbaseurl=https://packages.microsoft.com/yumrepos/vscodenenabled=1ntype=rpm-mdngpgcheck=1ngpgkey=https://packages.microsoft.com/keys/microsoft.asc” > /etc/zypp/repos.d/vscode.repo’With the Repo and GPG key set up, install Visual Studio Code on OpenSUSE with the Zypper commands below.zypper refresh
zypper install codeFlatpak instructionsVisual Studio Code is available on Flatpak, so you can install it on pretty much every Linux distribution out there. To install it, head over to our tutorial and set up the Flatpak runtime. Then enter the installation commands below.flatpak install flathub com.visualstudio.code.oss
flatpak remote-add –if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepoSnap package instructionsVisual Studio Code is in the Snap store. To get it working, head over to our tutorial on how to enable Snapd. Then, once you’ve got it working, enter the command below to install the program.sudo snap install vscode –classicRead How to install Microsoft Visual Studio Code on Linux by Derrik Diener on AddictiveTips – Tech tips to make you smarter
How to install Microsoft Visual Studio Code on Linux