How to Install Visual Studio Code on Ubuntu 26.04 LTS (Resolute Raccoon)

You just installed Ubuntu 26.04 LTS. The desktop is clean. GNOME 50 looks gorgeous. But there’s one thing missing—your code editor. And let’s be honest, while GNOME Text Editor (formerly gedit) works for quick notes, you’re going to want something with real IntelliSense, debugging, Git integration, and that massive extension marketplace.

That’s Visual Studio Code.

VS Code on Linux has come a long way. In 2026, with Ubuntu 26.04’s Wayland-only GNOME 50 session, there’s one critical tweak you need to make for a crisp, lag-free experience. This guide covers the install, that Wayland fix, and the extensions you’ll actually want on day one.


Option 1: Microsoft APT Repository (Recommended)

The proper way to install VS Code on Ubuntu is through Microsoft’s official APT repository. This gives you automatic updates through apt upgrade and the most stable package.

Step 1: Install dependencies

Bash
sudo apt update
sudo apt install -y wget gpg

Step 2: Import Microsoft’s GPG key

Bash
sudo install -d -m 0755 /etc/apt/keyrings
wget -qO- https://packages.microsoft.com/keys/microsoft.asc 
  | sudo gpg --dearmor -o /etc/apt/keyrings/packages.microsoft.gpg
sudo chmod 644 /etc/apt/keyrings/packages.microsoft.gpg

Step 3: Add the VS Code repository

Bash
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" 
  | sudo tee /etc/apt/sources.list.d/vscode.list

Step 4: Install

Bash
sudo apt update
sudo apt install -y code

Verify it works:

Bash
code --version

Expected output: 1.xx.x followed by a commit hash and architecture.


Option 2: Snap (One Command)

If you prefer containerized packages, VS Code is available as a Snap. It’s the fastest install:

Bash
sudo snap install --classic code

The --classic flag is required because VS Code needs full system access for its terminal and debugger.

Downside: Snap updates are automatic and unavoidable. If you dislike Snap’s update model, use the APT method above.


Option 3: Manual .deb Download

For one-off installs or air-gapped machines, download the .deb directly:

Bash
wget -O code-latest.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"
sudo dpkg -i code-latest.deb
sudo apt install -f  # fix any missing dependencies

Critical: Wayland Fix for GNOME 50

Here’s the part almost every guide misses.

Ubuntu 26.04 ships GNOME 50 as Wayland-only. Electron apps (including VS Code) default to running through XWayland. On a 4K or HiDPI display, this produces fuzzy text and a slightly laggy window drag.

The fix is a single config file that tells VS Code to use Wayland natively:

Bash
mkdir -p ~/.config
cat > ~/.config/code-flags.conf <<'EOF'
--ozone-platform-hint=auto
--enable-features=UseOzonePlatform,WaylandWindowDecorations
EOF

What this does:

  • --ozone-platform-hint=auto lets Electron detect and use Wayland when available
  • WaylandWindowDecorations enables native GNOME client-side decorations

Restart VS Code. Open Ctrl+Shift+P → “Developer: Open Process Explorer”. The main process should now show --ozone-platform-hint=auto. The difference in text sharpness is immediately visible.

This flag file also works for VS Code Insiders (code-insiders-flags.conf) and the OSS build (code-oss).


Must-Have Extensions

VS Code is useful out of the box, but these three make it a real development environment. Install from the terminal so you can script the same setup across machines:

Bash
code --install-extension ms-python.python
code --install-extension ms-vscode-remote.remote-ssh
code --install-extension eamodio.gitlens
  • Python — IntelliSense, linting, debugging, Jupyter support
  • Remote – SSH — edit files on remote servers without leaving VS Code
  • GitLens — inline Git blame, history explorer, code lens

Launching VS Code

From the terminal:

Bash
code .

This opens the current directory in VS Code. You can also open a specific file:

Bash
code ~/project/main.py

Or from the GNOME Activities overview, search for “Visual Studio Code” and launch it graphically.


Uninstalling

If installed via APT:

Bash
sudo apt purge --autoremove -y code
sudo rm /etc/apt/sources.list.d/vscode.list
sudo rm /etc/apt/keyrings/packages.microsoft.gpg

If installed via Snap:

Bash
sudo snap remove code

Final Thoughts

VS Code on Ubuntu 26.04 LTS works great—once you apply that Wayland flag. Without it, the experience is merely okay. With it, the editor feels native and responsive, with sharp text at any scaling level.

The APT method is the one I recommend: it keeps VS Code in sync with your system updates, gives you control over when to upgrade, and works identically across amd64 and arm64 machines. Install the extensions, apply the Wayland fix, and you’ve got a development environment that rivals what you’d get on macOS or Windows.

Now go build something.

Last modified: 2026年7月10日

Author

Comments

Write a Reply or Comment

Your email address will not be published.