How to Install Visual Studio Code on Ubuntu 18.04

· TanDD · 2 min read

A practical guide to the Microsoft APT repository method for VS Code on Ubuntu 18.04, with current compatibility notes.

Ubuntu 18.04 (Bionic Beaver) can install Visual Studio Code from Microsoft’s APT repository. This guide documents that method for existing Bionic systems. Ubuntu 18.04 is past standard support, and current VS Code releases may need newer system libraries; check the compatibility note before using the latest package.

Before you start

Ubuntu 18.04 has reached the end of standard support. Microsoft’s current VS Code release requires newer system libraries than Bionic includes, so these repository steps are historical. They may install a package that cannot run on a fully updated Ubuntu 18.04 system. Upgrade Ubuntu for a supported VS Code installation.

Install from Microsoft’s APT repository

The following commands add Microsoft’s signing key and stable package feed, refresh APT, and install the code package. Use an account that can run sudo.

sudo apt update
sudo apt install wget gpg
sudo install -d -m 0755 /usr/share/keyrings
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/microsoft.gpg > /dev/null
sudo chmod 644 /usr/share/keyrings/microsoft.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
sudo apt update
sudo apt install code

Launch VS Code and keep it updated

Start the editor from the applications menu or launch it in a terminal. Packages installed from the Microsoft feed update through APT.

code --version
sudo apt update && sudo apt upgrade

Compatibility and source

Ubuntu 18.04 ships with glibc 2.27, while current VS Code releases require glibc 2.28 or later. Installing the package does not remove this runtime limitation. Upgrade to a supported Ubuntu release to run the current editor. For historical background, see Linuxize’s article “How to Install Visual Studio Code on Ubuntu 18.04”: https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-18-04/. This guide is independently written from general package-management steps.

Related posts