If Visual Studio Code refuses to install on your Ubuntu Desktop machine, you're not alone. The two most common failure points are the .deb package install via dpkg throwing dependency errors, and the official Microsoft apt repository failing with GPG key or signature errors. Both issues have straightforward, permanent fixes once you understand what's actually happening under the hood — this guide walks through every real error message you'll see and exactly how to resolve it.
Why VS Code Fails to Install on Ubuntu Desktop
VS Code on Ubuntu can be installed three different ways: downloading the .deb file directly from code.visualstudio.com, adding Microsoft's official apt repository, or installing the Snap package. Each method fails for different reasons:
- The .deb package can fail with
dpkg: dependency problems prevent configurationwhen required libraries (like a specificlibc6orlibgtkversion) aren't present on your system. - The Microsoft apt repository commonly fails with
NO_PUBKEY EB3E94ADBE1229CForThe following signatures couldn't be verifiedbecause newer Ubuntu releases removed the deprecatedapt-keytool and require GPG keys to live in/etc/apt/keyrings/. - The Snap package can fail if
snapditself is broken, or the app hangs on first launch due to sandboxing restrictions.
Below are step-by-step fixes for each scenario.
💡 None of these worked? Skip the guesswork.
Get Expert Help →Method 1: Fix .deb Package Installation Errors with dpkg and apt
If you downloaded the .deb installer directly from the VS Code website, install it correctly the first time using apt instead of raw dpkg, since apt resolves dependencies automatically:
Navigate to your Downloads folder and run:
cd ~/Downloads
sudo apt install ./code_1.96.0-1234567890_amd64.deb
Using apt install ./file.deb (with the leading ./) tells apt to treat the local file as a package and automatically pull in any missing dependencies from your configured repositories.
If you ran sudo dpkg -i code_*.deb first and saw:
dpkg: dependency problems prevent configuration of code:
code depends on libgtk-3-0 (>= 3.9.10); however:
Package libgtk-3-0 is not installed.
dpkg: error processing package code (--configure):
dependency problems - leaving unconfigured
Fix it by letting apt finish the job:
sudo apt --fix-broken install
sudo apt install -f
This pulls in every missing dependency and re-configures the partially installed package.
Sometimes the dependency simply isn't in your local package cache yet:
sudo apt update
sudo apt --fix-broken install
On Ubuntu 26.04 and other very recent releases, you may see Error: Cannot satisfy dependencies because the .deb build expects an older library version than what's shipped. In this case, skip the standalone .deb entirely and use the apt repository method below (Method 2) or the Snap package (Method 3) instead — both are actively maintained against current Ubuntu releases, while a manually downloaded .deb is a snapshot in time.
sudo apt update
sudo apt install wget gpg
Newer Ubuntu versions removed the deprecated apt-key command, so the key must be stored as a standalone file:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
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
sudo apt update
sudo apt install code
If apt update shows:
W: GPG error: https://packages.microsoft.com/repos/code stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
This means an old repository entry exists without the signed-by path, or the key file is missing/corrupted. Remove any old, incorrect entries and re-run steps 2-4:
sudo rm /etc/apt/sources.list.d/vscode.list
sudo rm -f /etc/apt/trusted.gpg.d/microsoft*.gpg
Then repeat the key import and repository steps above exactly. Do not mix the old apt-key add method with the new signed-by method — having both creates duplicate, conflicting key entries.
If you see The repository 'https://packages.microsoft.com/... InRelease' is no longer signed, your /etc/apt/sources.list.d/vscode.list file is likely malformed or duplicated. Check for duplicate entries and remove extras:
grep -r "packages.microsoft.com" /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/vscode.list
Keep only one clean line as shown in step 3, then run sudo apt update again.
Method 3: Install VS Code via Snap as a Reliable Alternative
If you'd rather avoid managing apt repositories and GPG keys entirely, the Snap package is officially maintained by Microsoft and sandboxed by default:
sudo snap install code --classic
The --classic flag is required because VS Code needs broader filesystem access than Snap's default confinement allows (for opening arbitrary project folders, running extensions, and using integrated terminals).
Trade-offs to know before switching to Snap:
- Snap updates are automatic but can lag a day or two behind the apt repository release.
- First launch is often slower than the apt/deb version due to Snap's mount-based packaging.
- Some extensions that need direct system integration (certain USB debugging tools, hardware debuggers) behave better on the apt-installed version even with
--classicconfinement.
If snap install itself fails, ensure snapd is healthy first:
sudo systemctl status snapd
sudo systemctl restart snapd
sudo snap install code --classic
Fixing Common Post-Install Issues (Won't Launch, Missing Icon)
Once installed, a few more issues commonly appear:
VS Code icon missing from the Applications menu
sudo update-desktop-database
sudo gtk-update-icon-cache
Then log out and back in, or restart GNOME Shell with Alt+F2 then r (X11 sessions only).
VS Code launches but window is blank or crashes immediately
This is usually a GPU/Electron rendering issue on certain NVIDIA driver combinations. Launch with hardware acceleration disabled to confirm:
code --disable-gpu
If that resolves it, add --disable-gpu permanently to your desktop launcher, or update your graphics drivers.
"code: command not found" after apt install
Your shell's PATH cache may be stale. Run hash -r or open a new terminal window — the apt-installed version places the binary in /usr/bin/code which should already be on PATH.
When to Get Professional Linux Desktop Support
Most VS Code installation failures on Ubuntu Desktop are resolved by the steps above, but repository conflicts, broken snapd installations, or deeper dependency chain issues (especially after a distribution upgrade) can eat hours of troubleshooting time. If you manage multiple Ubuntu workstations for a team, or you'd rather have a specialist fix it once and document it properly, CloudHouse Technologies offers pay-per-ticket Linux desktop support so you only pay for the issue you need resolved — no subscription required.
Whether it's a stubborn .deb dependency error, a broken apt repository, or a Snap sandboxing quirk, getting VS Code running reliably on Ubuntu Desktop shouldn't take all afternoon. Use the apt repository method for long-term stability, keep an eye on GPG key locations after major Ubuntu upgrades, and fall back to Snap if you want a zero-maintenance install.
