Step-by-Step Guide to VSCode Installation on Linux
Visual Studio Code, commonly known as VSCode, stands out as a favored code editor within the developer community owing to its lightweight nature, extensibility, and user-friendly interface. This software is crafted by Microsoft and is compatible with Windows, macOS, and Linux operating systems. In this piece, we’ll walk you through the step-by-step process of installing VSCode specifically on a Linux system.
What are the prerequisites for installing Vscode on Linux?
Before we delve into the installation process, there are several prerequisites that must be fulfilled to successfully install VSCode on a Linux system. These prerequisites include:
- A 64-bit Linux distribution with a modern desktop environment such as GNOME, KDE, or Unity;
- A recent version of the .NET Core runtime (version 3.1 or later);
- A recent version of the libgconf library (version 2.32 or later);
- A recent version of the libsecret library (version 0.18 or later).
To verify if your system meets these requirements, you can execute the following commands in your terminal:
$ lsb_release -a
$ uname -m
$ dotnet --version
$ gconftool-2 --version
$ libsecret-1 --version
If any of these commands do not return a valid output, it indicates that you will need to install the missing dependencies before proceeding with the installation.
How do you install Vscode on Linux?
There are two ways to install VSCode on Linux: using the official .deb or .rpm package, or using the snap package. We will cover both methods in this article.
Using the Official .deb or .rpm Package
The easiest way to install VSCode on Linux is by using the official .deb or .rpm package. However, please note that this method is only available for Ubuntu, Debian, Fedora, and CentOS distributions.
To install VSCode using this method, follow these steps:
- Download the latest .deb or .rpm package from the official VSCode website;
- Once the download is complete, navigate to the directory where the package is saved;
- Install the package by running the following command:
$ sudo dpkg -i .deb
# for Debian/Ubuntu
$ sudo rpm -i .rpm
# for Fedora/CentOS
If any dependencies are missing, you will be prompted to install them. Follow the instructions on your screen to complete the installation.
- Once the installation is complete, you can launch VSCode from your application menu or by running the codecommand in your terminal.
Using the Snap Package
To leverage the snap package for the installation of Visual Studio Code (VSCode) across various Linux distributions, it’s essential to ensure the presence of ‘snapd’ on your system. This package management system simplifies the process of software installation and updates, making it a versatile choice for users. However, it’s worth noting that initial setup might necessitate some additional steps.
Firstly, verify if ‘snapd’ is already installed on your Linux system. If it’s absent, installation commands will differ based on the distribution you’re using. For Debian or Ubuntu users, execute sudo apt install snapd to install ‘snapd’. Fedora users, on the other hand, should use sudo dnf install snapd for the same purpose.
Post ‘snapd’ installation, you’re set to install VSCode. Execute the command sudo snap install code –classic. The –classic flag is crucial as it grants VSCode access to your system’s files and processes, a necessity for a development environment.
After the successful completion of the installation process, VSCode can be accessed easily. You can either find it in your application menu or initiate it directly from the terminal by typing code. This straightforward method ensures a seamless setup, allowing you to dive into your development work with minimal delay.
How to Install VSCode on Linux: A Step-by-Step Guide
After successfully installing VSCode on your Linux system, there are a few configurations that you may want to make to enhance your coding experience.
Changing the Default Font
By default, VSCode uses the Monospace font for its editor. However, you can change this to any font of your choice by following these steps:
- Open VSCode and go to File > Preferences > Settings;
- In the search bar, type “font” and click on “Text Editor: Font”;
- Click on “Edit in settings.json” and add the following line:
“editor.fontFamily”: “”
- Replace with the name of your desired font;
- Save the changes and restart VSCode for the changes to take effect.
Installing Extensions
One of the best features of VSCode is its extensibility. There are thousands of extensions available that can enhance your coding experience and make your workflow more efficient. To install an extension, follow these steps:
- Open VSCode and click on the Extensions icon on the left sidebar;
- Search for the extension you want to install and click on “Install”;
- Once the installation is complete, click on “Reload” to activate the extension.
You can also browse and install extensions from the VSCode Marketplace.
Customizing Keyboard Shortcuts
VSCode allows you to customize keyboard shortcuts according to your preferences. To do this, follow these steps:
- Open VSCode and go to File > Preferences > Keyboard Shortcuts;
- You can either edit the existing shortcuts or create new ones by clicking on the “+” icon next to the command you want to assign a shortcut to;
- Once you have made your changes, save them and they will be applied immediately.
HOW TO INSTALL VISUAL STUDIO CODE VIA TERMINAL ON LINUX MINT!
How to Troubleshoot Common Issues When Installing VSCode on Linux?
When installing VSCode on Linux, the process is typically smooth. However, you might encounter some issues along the way. Here are some common problems and their solutions:
1. VSCode Won’t Launch
A frequent hurdle post-installation is when VSCode refuses to launch. This often stems from missing dependencies that are crucial for the application to run. It’s imperative to cross-reference your system’s installed packages with the prerequisites outlined in the VSCode installation guide for Linux. This ensures that all necessary components are in place, thereby mitigating launch issues.
2. Challenges in Installing Extensions
Extensions enhance VSCode’s functionality, but sometimes you might face difficulties in adding them. This problem typically arises from network-related issues that obstruct the connection to the VSCode Extensions Marketplace. Alternatively, the complication might lie within the extension itself. To address this, first, verify your internet connectivity to rule out network problems. If the issue remains, it could be beneficial to reach out to the extension’s developer or consult the extension’s documentation for any known issues and potential fixes.
3. Degraded Performance in VSCode
Experiencing a slowdown in VSCode’s performance on Linux can be attributed to excessive CPU usage, often caused by specific extensions or background processes consuming significant system resources. To alleviate this, consider auditing your currently enabled extensions and deactivate those that are not essential to your workflow. Additionally, it’s wise to close any non-essential applications that might be contributing to the system’s load, thereby ensuring that VSCode can operate more efficiently.