UbuntuUbuntu Based

How To Install Visual Studio Code on Ubuntu 24.04 LTS

Install Visual Studio Code on Ubuntu 24.04

In this tutorial, we will show you how to install Visual Studio Code on Ubuntu 24.04 LTS. Visual Studio Code (VS Code) is a powerful, open-source code editor developed by Microsoft. It has gained immense popularity among developers due to its versatility, customizability, and extensive language support. Whether you’re a seasoned programmer or just starting your coding journey, VS Code offers a rich and user-friendly environment for writing, debugging, and managing your projects.

One of the great advantages of VS Code is its cross-platform availability, which means you can use it on various operating systems, including Ubuntu 24.04. In this comprehensive guide, we’ll walk you through multiple methods to install Visual Studio Code on your Ubuntu 24.04 system, ensuring you have a seamless experience from start to finish.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Visual Studio Code on Ubuntu 24.04 (Noble Numbat). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

  • A server running one of the following operating systems: Ubuntu and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
  • An Ubuntu 24.04 system with root access or a user with sudo privileges.

Install Visual Studio Code on Ubuntu 24.04 LTS Noble Numbat

Step 1. Updating the Package Repository.

Start by updating your system to ensure all existing packages are up-to-date. Open a terminal and execute the following commands:

sudo apt update
sudo apt upgrade

This will refresh the package lists and upgrade any outdated packages, which is essential for maintaining system stability and security.

Step 2. Installing Dependencies.

You’ll need to install a few packages to facilitate the installation process:

sudo apt install wget gpg apt-transport-https

Step 3. Installing Visual Studio Code on Ubuntu 24.04.

  • Method 1: Install via Ubuntu Repositories

One of the most straightforward ways to install Visual Studio Code on Ubuntu 24.04 is through the official Ubuntu repositories. This step ensures that the packages you download are authentic and from a trusted source:

sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null

Add the Visual Studio Code repository to your system’s sources list:

sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

Refresh the package cache to ensure your system has the latest package information:

sudo apt update

Now, you can install the Visual Studio Code package using the apt package manager:

sudo apt install code

After the installation is complete, you can verify the installed version of Visual Studio Code by running:

code --version

You can launch Visual Studio Code from the terminal by typing code or by searching for it in the Ubuntu application menu.

Install Visual Studio Code on Ubuntu 24.04

  • Method 2: Install via Snap Package

Ubuntu 24.04 also supports installing applications through Snap packages, which provide an easy and secure way to install and manage software. Here’s how to install Visual Studio Code using the Snap package:

sudo apt install snapd

Once Snap is installed, you can install Visual Studio Code by running the following command:

sudo snap install --classic code

To verify that Visual Studio Code has been installed successfully, run:

snap list

You can launch Visual Studio Code from the terminal by typing code or by searching for it in the Ubuntu application menu.

Method 3: Install via .deb Package.

If you prefer a more direct approach, you can download and install the .deb package from the official Visual Studio Code website. Here’s how:

Visit the official Visual Studio Code website and download the latest .deb package for Ubuntu. Alternatively, you can use the following wget command to download it directly:

wget https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64 -O code.deb

Once the download is complete, navigate to the directory where the .deb file is located and install it using one of the following commands:

sudo dpkg -i code_<version>_amd64.deb

If there are dependency issues, resolve them by running:

sudo apt-get install -f
  • Method 4: Install via Ubuntu Software Center (GUI)

If you prefer a graphical user interface (GUI) approach, you can install Visual Studio Code through the Ubuntu Software Center. Here’s how:

    1. Open the Ubuntu Software Center: Search for “Ubuntu Software” in the application menu or use the shortcut key Super + A to launch the Ubuntu Software Center.
    2. Search for Visual Studio Code: In the search bar of the Ubuntu Software Center, type “Visual Studio Code” and press Enter.
    3. Install Visual Studio Code: Locate the official Visual Studio Code package in the search results and click the “Install” button.
    4. Verify and launch: After the installation is complete, you can verify the installed version by running code --version in the terminal. To launch Visual Studio Code, search for it in the Ubuntu application menu or use the shortcut key Super + A to open the Ubuntu Software Center and click the “Launch” button next to Visual Studio Code.

Install Visual Studio Code on Ubuntu 24.04 LTS Noble Numbat

Congratulations! You have successfully installed Visual Studio Code. Thanks for using this tutorial for installing the Visual Studio Code on the Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the Visual Studio Code website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button