How to Install Visual Studio Code on Pop!_OS

Visual Studio Code (VSCode) is Microsoft’s premier code editor, offering a harmonious blend of user-friendly features with the robust capabilities of an Integrated Development Environment (IDE). For those seeking to install Visual Studio Code (VSCode) on Pop!_OS, this introduction delves into its standout attributes and benefits to the development landscape.

Key Highlights of Visual Studio Code:

  • Cross-Platform Flexibility: With support for Windows, Linux, and macOS, VSCode ensures a consistent development experience across diverse platforms.
  • Adaptable Environment: The vast extensions marketplace allows developers to tailor VSCode to their needs, encompassing various languages, tools, and frameworks.
  • IntelliSense Integration: Microsoft’s IntelliSense enhances coding efficiency by providing context-aware code completions, streamlining the development process.
  • Comprehensive Debugging: Integrated debugging tools within VSCode allow for in-editor code inspection, from setting breakpoints to viewing call stacks.
  • Git Collaboration: Native Git support facilitates version control tasks directly within the editor, enhancing workflow continuity.
  • Real-Time Collaboration: The Live Share feature promotes collaborative coding sessions, enabling real-time code sharing and joint debugging.
  • Consistent Experience: The Settings Sync feature ensures a uniform editor setup across devices, ideal for developers who switch between workstations.
  • Integrated Terminal: Direct access to a shell within VSCode simplifies command execution and script management, further consolidating its all-in-one development environment.

VSCode is a comprehensive, adaptable, and feature-rich code editor, making it an indispensable tool for developers worldwide. As we transition to the next section, we’ll guide you through the steps to seamlessly install Visual Studio Code (VSCode) on Pop!_OS, ensuring you’re equipped with this powerful editor for your coding endeavors.

Install Visual Studio Code on Pop!_OS via APT

Step 1: Refresh Pop!_OS Packages Before VSCode Installation

Visual Studio Code (VSCode) installation on your Pop!_OS system begins with an essential yet straightforward task: updating your system packages. This is a vital step to avoid any potential conflicts or issues arising during installation due to outdated packages.

To achieve this, you’ll need to execute the following command in your terminal:

sudo apt update

This command interacts with Pop!_OS’s repositories, fetching the latest information about any available updates for your installed packages. Once you’ve done this, it’s time to upgrade any outdated packages to ensure your system is primed and ready for the subsequent steps. To do this, you’ll use the command:

sudo apt upgrade

Step 2: Install Initial Packages Required For Installation on Pop!_OS

With an up-to-date system, we can proceed to the next phase of our installation journey. This step involves installing specific packages that will facilitate the seamless installation of VSCode. The required packages include dirmngr, software-properties-common, apt-transport-https, and curl. These are standard software packages commonly found in most Linux distributions. Each plays a crucial role in handling tasks such as managing repositories, managing https transport, and data transfer.

To install these packages, you will use the following command:

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y

Step 3: Import VSCode APT Repository on Pop!_OS

Now that the necessary packages are in place, it’s time to import Microsoft’s GPG key. This key is a pivotal element in the process as it verifies the authenticity of the VSCode package we will install. It ensures that the software we are installing is genuine and untampered.

To import the GPG key, you will need to execute the following command:

curl -fSsL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg >/dev/null

After successfully importing the GPG key, it’s time to import the Microsoft Visual Code Source Repository. This repository houses the VSCode packages that we aim to install. To perform this task, you will need to run the command:

echo deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main | sudo tee /etc/apt/sources.list.d/vscode.list

Step 4: Install Visual Studio Code (VSCode) on Pop!_OS

We must refresh our apt package manager’s sources list with the repository added. This ensures that apt recognizes the newly added VSCode repository and fetches the appropriate package information. To refresh the sources list, you will need to execute the following:

sudo apt update

We’re ready to install Visual Studio Code on Pop!_OS. Depending on your preferences, you can choose to install the stable build of VSCode or opt for the insider build. The stable build is the official, thoroughly tested, and supported version of VSCode, whereas the insider build offers users a chance to try out new features before they’re officially released.

To install VSCode on Pop!_OS with the stable build, use the command:

sudo apt install code

Alternatively, if you’re feeling adventurous and wish to install the VSCode insider build on Pop!_OS, execute the following:

sudo apt install code-insiders

Install Visual Studio Code on Pop!_OS via Flatpak and Flathub

Flatpak is a widely recognized universal package manager, and while it often comes pre-installed on Pop!_OS, there can be exceptions, such as when it has been manually removed. One of the chief reasons to use Flatpak, especially in sync with the Flathub repository, is its capability to offer up-to-date software versions. This contrasts Pop!_OS’s default repository, which tends to prioritize stability. As a result, this default repository often retains older software versions, focusing mainly on updating when there are pressing security concerns or significant software glitches.

Step 1: Enable Flatpak For VSCode on Pop!_OS

To get started with Flatpak on your system, enter the command below into your terminal:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

By executing this command, you’re telling the system to recognize and add the Flathub repository if it isn’t already present.

Step 2: Installing Visual Studio Code using Flatpak

After you’ve ensured that Flatpak is up and running on your system, it’s time to install Visual Studio Code. The process is straightforward and can be executed with the following Flatpak command:

flatpak install flathub com.visualstudio.code -y

Running this command will fetch and install the latest version of Visual Studio Code available from the Flathub repository. This approach ensures you’re equipped with the most recent version made accessible via this platform.

Launch Visual Studio Code on Pop!_OS

CLI Methods to Launch Visual Studio Code on Pop!_OS

Congratulations on successfully installing Visual Studio Code on your Pop!_OS system! Now begins the exciting phase of discovering this software’s powerful features. There are multiple methods to launch the application, one of which is through the terminal—perfect for those who prefer a command line interface or wish to open VSCode within a specific directory.

If you chose to install the stable build of Visual Studio Code, you can initiate the application by entering the following command into your terminal:

code

If, however, you opted for the insider build and are eager to test out the latest features, you’ll need a slightly different command to launch the application:

code-insiders

Lastly, VSCode installations that were done with Flatpak need to run the following command:

flatpak run com.visualstudio.code

CLI Methods to Launch Visual Studio Code on Pop!_OS

Visual Studio Code can be launched effortlessly using Pop!_OS’s Graphical User Interface (GUI) for those who gravitate more towards visual navigation. The GUI presents an intuitive path to the application, eliminating the need for command line input. Here’s how you can navigate to VSCode using the GUI:

  • Next, look for Show Applications, typically symbolized by a grid, and click on it.
  • A search bar will appear. Here, type in “Visual Studio Code.” As you start typing, you’ll notice the VSCode icon begin to surface.
  • Finally, click on the Visual Studio Code icon to launch the application.
Visual Studio Code application icon on Pop!_OS.
Click to launch Visual Studio Code from your Pop!_OS application menu.

Tips on Getting Started with Visual Studio Code on Pop!_OS

As you embark on your coding journey with Visual Studio Code on Pop!_OS, here are some crucial tips to enhance your user experience and boost productivity.

Enhance your Pop!_OS Experience with VSCode Extensions

Visual Studio Code offers a plethora of extensions to customize your coding environment to your liking. These extensions can range from language support debugging tools to aesthetic changes to make your environment more visually pleasing. To install an extension, follow these steps:

1. Click on the Extensions view icon on the Sidebar (It looks like a square inside a square).
2. Search for the extension you want.
3. Click Install.

Keybinding Customizations in VSCode on Pop!_OS

Visual Studio Code allows you to tailor your keyboard shortcuts according to your preferences. This feature can significantly boost your coding speed, as you’ll spend less time navigating menus and more time coding. Here’s how to customize your keybindings:

1. Click File > Preferences > Keyboard Shortcuts.
2. Find the command you want to change and click on the pencil icon.
3. Press the key combination you want to assign to the command and hit Enter.

Integrated Terminal in VSCode on Pop!_OS

Visual Studio Code has an integrated terminal, so you don’t have to switch between the code editor and the terminal. You can open the terminal by clicking View > Terminal or using the shortcut `Ctrl + “.

Git Integration in VSCode on Pop!_OS

Visual Studio Code has built-in Git integration, making version control a breeze. To initialize a Git repository, you can open the source control view (the icon that looks like a branching tree), click on + to initialize a repository and start committing your changes.

Debug Tools in VSCode on Pop!_OS

VSCode comes packed with debugging tools, which can be a significant boon to your development workflow. You can set breakpoints, step through your code, inspect variables, and more. You can start debugging by clicking on the bug icon on the left sidebar and then clicking on the green ‘Start Debugging’ button,

Active Visual Studio Code window on a Pop!_OS desktop.
Experience the seamless integration of Visual Studio Code on Pop!_OS.

Additional Visual Studio Code Commands with Pop!_OS

In the course of your work with Visual Studio Code on Pop!_OS Linux, there might be instances where you need to uninstall the software. A variety of reasons could prompt this. Perhaps you need to free up disk space on your system, or you are troubleshooting an issue, or maybe you simply no longer need the software. Whatever the reason, knowing how to remove Visual Studio Code effectively is essential, leaving no residual files behind. This part of the article provides a comprehensive guide to achieving this.

Remove Visual Studio Code From Pop!_OS

APT Method to Remove VSCode from Pop!_OS

The uninstallation method can differ slightly based on the specific version of Visual Studio Code installed on your system. This is why using the appropriate command that aligns with your installation is paramount.

If you have the stable build of Visual Studio Code installed on your system, the command that you would use to remove it is as follows:

sudo apt remove code

On the other hand, if you chose the insider’s build of Visual Studio Code, the command to use for removal is:

sudo apt remove code-insiders

During the execution of this command, your system will prompt you for confirmation. To proceed with the uninstallation, type y and press the Enter key. This action will effectively remove the Visual Studio Code application from your system.

Remove VSCode APT Repository

Once the software has been uninstalled, the subsequent step involves removing the repository associated with Visual Studio Code. This is crucial because it prevents your system from continuously checking for updates related to the already removed software. To accomplish the removal of the repository, run the command below:

sudo rm /etc/apt/sources.list.d/vscode.list

Delete the GPG Key Associated with VSCode on Pop!_OS

The final step in the uninstallation process is deleting the GPG key related to Visual Studio Code. The GPG key serves as a security feature that verifies the authenticity of the software packages. Therefore, when you’ve successfully removed both the software and its repository, it is a good practice to eliminate the GPG key to uphold your system’s security. This task can be achieved by using the following command:

sudo rm /usr/share/keyrings/vscode.gpg

Flatpak Method to Remove VSCode from Pop!_OS

To remove Visual Studio Code that was installed via Flatpak, run the following command:

flatpak uninstall com.visualstudio.code

This command will prompt you to remove the software.

Closing Thoughts

In conclusion, installing Visual Studio Code on Pop!_OS is a straightforward process but one that necessitates attention to detail. We’ve covered the necessary steps to install, manage, and uninstall Visual Studio Code effectively, ensuring a clean and secure system environment.