In this tutorial, you will learn how to install VS Code on Ubuntu 24.04. VS Code, an acronym for Visual Studio code is a free and lightweight source code editor developed by Microsoft that is used by programmers to edit, debug and manage their source codes. VS Code support various programming languages. If you are a programmer and you are running an Ubuntu 24.04 desktop system, it would really be handy to have VS Code installed.
Table of Contents
Installing Visual Studio Code on Ubuntu 24.04
There are multiple ways in which one can use to install VS Code on an Ubuntu 24.04 box. These include;
- Install VS Code from Microsoft Code APT Repository
- Installing VS Code using Prebuilt Debian Binary
- Install from Snapstore
- Installing from Flathub
Install VS Code on Ubuntu fro MS Code APT Repository
Microsoft maintains a repository for distributing packages related to Visual Studio Code (VS Code). You need to install this repository on Ubuntu 24.04 system.
Therefore, run system package cache update;
sudo apt update && sudo apt upgrade -y
Reboot if needed;
[ -f /var/run/reboot-required ] && sudo systemctl reboot
install some required packages.
sudo apt install wget gnupg2 apt-transport-https
Install repository signing GPG key;
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/microsoft.gpg
Then install the repository itself;
echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
Run system update and install VS Code on Ubuntu;
sudo apt update
sudo apt install code
Installing VS Code using Prebuilt Debian Binary
You can download prebuilt debian binary from the downloads page.
Or simply get the download link address and pull down the binary using wget or curl command.
wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code_1.88.1-1712771838_amd64.deb
The install it;
sudo apt update && sudo apt upgrade -y
Reboot if required.
[ -f /var/run/reboot-required ] && sudo systemctl reboot
Then install VS Code using prebuilt binary;
sudo apt install ./code_1.88.1-1712771838_amd64.deb
Installing VS Code via Snap store
VS Code is also distributed on Snap store. Since snap is already installed on Ubuntu 24.04, you can simply install the code using the command below;
sudo snap install --classic code
Install Code from Flathub
VS Code is also distributed in Flathub. To install it from Flathub on Ubuntu 24.04;
Install Flatpak package manager;
sudo apt install flatpak
Enable Flathub repository;
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
Get VS Code app ID from the repository;
sudo flatpak search code | grep "Visual Studio Code"
Visual Studio Code Code editing. Redefined. com.visualstudio.code 1.88.0 stable flathub
Code - OSS Visual Studio Code. Code editing. Redefined. com.visualstudio.code-oss 1.74.3 stable flathub
So the VS Code Flathub app ID is com.visualstudio.code.
sudo flatpak install com.visualstudio.code
Looking for matches…
Required runtime for com.visualstudio.code/x86_64/stable (runtime/org.freedesktop.Sdk/x86_64/23.08) found in remote flathub
Do you want to install it? [Y/n]: y
com.visualstudio.code permissions:
ipc network pulseaudio ssh-auth x11 devices
devel file access [1] dbus access [2] system dbus access [3] tags [4]
[1] host
[2] com.canonical.AppMenu.Registrar, com.canonical.AppMenu.Registrar.*, org.freedesktop.Flatpak, org.freedesktop.Notifications, org.freedesktop.secrets
[3] org.freedesktop.login1
[4] proprietary
ID Branch Op Remote Download
1. [✓] org.freedesktop.Platform.GL.default 23.08 i flathub 164.6 MB / 164.6 MB
2. [✓] org.freedesktop.Platform.GL.default 23.08-extra i flathub 18.5 MB / 164.6 MB
3. [✓] org.freedesktop.Platform.openh264 2.2.0 i flathub 886.7 kB / 944.3 kB
4. [✓] org.freedesktop.Sdk.Locale 23.08 i flathub 18.1 kB / 366.1 MB
5. [✓] org.freedesktop.Sdk 23.08 i flathub 482.6 MB / 559.5 MB
6. [✓] com.visualstudio.code stable i flathub 105.9 MB / 107.7 MB
Installing 6/6… ███████████████████▍ 97% 105.9 MB/s
Note that '/var/lib/flatpak/exports/share' is not in the search path
set by the XDG_DATA_HOME and XDG_DATA_DIRS
ID Branch Op Remote Download
1. [✓] org.freedesktop.Platform.GL.default 23.08 i flathub 164.6 MB / 164.6 MB
2. [✓] org.freedesktop.Platform.GL.default 23.08-extra i flathub 18.5 MB / 164.6 MB
3. [✓] org.freedesktop.Platform.openh264 2.2.0 i flathub 886.7 kB / 944.3 kB
4. [✓] org.freedesktop.Sdk.Locale 23.08 i flathub 18.1 kB / 366.1 MB
5. [✓] org.freedesktop.Sdk 23.08 i flathub 482.6 MB / 559.5 MB
6. [✓] com.visualstudio.code stable i flathub 105.9 MB / 107.7 MB
Installation complete.
Launching VS Code on Ubuntu 24.04
Irrespective of the method of installation, you should now be able to launch and use VS Code.
You can also launch from command line. If you installed VS Code using APT/Snap, run the command code from the terminal;
code
If you installed from Flathub, check installed apps and launch;
flatpak list
flatpak run com.visualstudio.code
Next, get started by selecting your theme and enable other options and mark done.
Get started with VS Code;
And that is how simple it is to install VS Code on Ubuntu 24.04.
Getting Started with VS Code
You can now get started with VS Code.