VS Code

How to Install VSCode on Ubuntu: Step-by-Step

How to Install VSCode on Ubuntu: Step-by-Step

Visual Studio Code runs on pretty much everything. But getting it onto Ubuntu? That trips up more people than you’d expect.

Learning how to install VSCode on Ubuntu takes about 10 minutes when you know the right method.

The problem is there are multiple approaches: .deb packages, the Snap store, Microsoft’s apt repository. Each has trade-offs.

This guide walks you through every option. You’ll set up your production environment with the terminal commands, troubleshoot common errors, and configure your code editor for actual development work.

By the end, you’ll have a fully functional Linux development environment ready for Python, JavaScript, or whatever language you’re working with.

How to Install VSCode on Ubuntu

maxresdefault How to Install VSCode on Ubuntu: Step-by-Step

Installing Visual Studio Code on Ubuntu is the process of adding Microsoft’s code editor to your Linux system using terminal commands or package managers.

Developers need this when setting up a web development IDE for Python, JavaScript, or other languages.

This guide covers 5 steps requiring approximately 10 minutes and basic familiarity with the Ubuntu terminal.

Prerequisites

Before you start, check these requirements:

  • Ubuntu version: 20.04 LTS, 22.04 LTS, or 24.04 LTS
  • System requirements: 1 GB RAM minimum, 500 MB disk space
  • Terminal access: GNOME Terminal or any command line interface
  • Permissions: sudo privileges for package installation
  • Internet connection: Required to download packages from Microsoft repository
  • Time estimate: 5-10 minutes depending on connection speed

Step One: How Do You Update Your System Packages?

Open Terminal (Ctrl+Alt+T) and run the apt update command to refresh your package list. This confirms your system can access the latest software versions from all configured repositories before adding new ones.

Action

Run this command:

sudo apt update && sudo apt upgrade -y `

Enter your password when prompted.

Wait for the package list to refresh. You should see “Reading package lists… Done” when complete.

Purpose

Outdated package lists cause dependency conflicts during installation. Running apt update first prevents these issues.

Step Two: How Do You Download the VSCode Package?

Download the official .deb package from Microsoft using wget or curl in your terminal. The deb package format works natively with Ubuntu’s dpkg installer and handles dependencies through apt.

Action

Download with wget:

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

The file saves to your current directory as vscode.deb.

File size is approximately 100 MB.

Alternative: Add Microsoft Repository

For automatic updates, add the official Microsoft apt repository instead:

` sudo apt install software-properties-common apt-transport-https wget -y 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 sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' `

Purpose

The direct download method works offline after download. The repository method keeps VSCode updated automatically with apt upgrade.

Step Three: How Do You Install VSCode Using the .deb Package?

Install the downloaded package using dpkg, then resolve any missing dependencies with apt. This registers VSCode in your system’s application menu and creates the “code” command for terminal access.

Action

Run the dpkg install command:

` sudo dpkg -i vscode.deb `

If you see dependency errors, fix them with:

` sudo apt install -f `

This pulls any missing libraries automatically.

Alternative: Install from Repository

If you added the Microsoft repository in Step Two:

` sudo apt update sudo apt install code -y `

Purpose

The dpkg command installs local .deb files directly. The apt install -f command resolves package dependencies that dpkg cannot fetch on its own.

Step Four: How Do You Launch VSCode for the First Time?

Open Visual Studio Code from the Ubuntu application menu or by typing “code” in Terminal. The first launch initializes your workspace configuration and extension marketplace access.

Action

Launch from Terminal:

` code `

Or open a specific folder:

` code /path/to/your/project `

From the GUI: Press the Super key, type “Visual Studio Code,” click the icon.

Create Desktop Shortcut

VSCode adds itself to the GNOME application menu automatically during installation.

Right-click the icon in Activities, select “Add to Favorites” for quick access.

Purpose

The “code” command launches VSCode from any directory, letting you open VSCode from terminal with a project already loaded.

Step Five: How Do You Install VSCode Using Snap?

The Snap store offers an alternative installation method with automatic updates and sandboxed execution. Snap packages work across all Linux distributions without modification.

Action

Install via snap:

` sudo snap install code --classic `

The –classic flag grants full system access required for source control and terminal integration.

Comparison: .deb vs Snap Installation

  • .deb method: 3 steps, full apt integration, faster startup, smaller disk footprint
  • Snap method: 1 command, automatic updates, sandboxed environment, slightly slower launch

Choose .deb for performance. Choose Snap for convenience.

Verification

Confirm the installation succeeded by checking the version number and testing core features.

Version Check

Run this command:

` code --version `

Expected output shows three lines: version number, commit hash, architecture (x64).

Functional Test

Open VSCode and verify these elements load correctly:

  • Welcome tab appears on first launch
  • Extensions marketplace accessible via Ctrl+Shift+X
  • Integrated terminal opens with Ctrl+ (backtick)
  • File Explorer panel visible on left sidebar

Troubleshooting

Issue: Missing Dependencies During Installation

Error message: “dependency problems – leaving unconfigured”

Solution:

sudo apt install -f sudo dpkg --configure -a `

Issue: Package Conflicts with Existing Installation

Happens when mixing Snap and .deb versions.

Solution: Remove all versions first:

` sudo apt remove code sudo snap remove code sudo apt autoremove `

Then reinstall using one method only.

Issue: VSCode Not Appearing in Application Menu

Solution: Refresh the desktop database:

` sudo update-desktop-database `

Log out and back in if the icon still doesn’t appear.

Issue: GPG Key Errors with Repository Method

Error: “The following signatures couldn’t be verified”

Solution: Re-import the Microsoft GPG key:

` 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 `

Next Steps

After installation, configure VSCode for your software development workflow.

Install Extensions

Press Ctrl+Shift+X to open the extension marketplace.

Recommended extensions by language:

  • Python: Python extension by Microsoft, Pylance
  • JavaScript/TypeScript: ESLint, Prettier
  • Git: GitLens, Git Graph

Connect to Version Control

VSCode includes native source control management for Git.

Learn how to connect VSCode to GitHub for repository integration.

Configure Settings

Access settings with Ctrl+, or open settings.json in VSCode directly for advanced configuration.

Set your preferred font in VSCode, color theme, and autoformat settings.

Learn Keyboard Shortcuts

Speed up your workflow with these shortcuts:

FAQ on How To Install VSCode On Ubuntu

What is the easiest way to install VSCode on Ubuntu?

The Snap store method requires just one command: sudo snap install code --classic. It handles updates automatically and works across all Ubuntu versions from 18.04 onward without adding repositories or importing GPG keys.

Can I install VSCode on Ubuntu without using Terminal?

Yes. Open Ubuntu Software Center, search for “Visual Studio Code,” and click Install. This uses the Snap package behind the scenes. The graphical method works but offers less control than command line installation.

What Ubuntu version do I need for VSCode?

VSCode supports Ubuntu 20.04 LTS, 22.04 LTS, and 24.04 LTS officially. Older versions like 18.04 work but may lack newer features. Microsoft recommends 64-bit systems with at least 1 GB RAM.

Should I use the .deb package or Snap to install VSCode?

Use .deb for faster startup and full apt integration. Choose Snap for automatic updates and simpler installation. The .deb method through Microsoft’s repository offers the best balance of performance and maintainability.

How do I update VSCode on Ubuntu after installation?

If installed via apt repository: sudo apt update && sudo apt upgrade code. For Snap installations, updates happen automatically. The software release cycle delivers monthly stable updates.

Why does VSCode installation fail with dependency errors?

Missing libraries cause most failures. Run sudo apt install -f after dpkg errors to resolve package dependencies automatically. Outdated package lists also trigger this issue, so always run apt update first.

How do I completely uninstall VSCode from Ubuntu?

For apt installation: sudo apt remove code && sudo apt autoremove. For Snap: sudo snap remove code. Delete ~/.config/Code and ~/.vscode folders to remove settings and extensions completely.

Can I install VSCode Insiders on Ubuntu?

Yes. Download the Insiders .deb package from code.visualstudio.com or run sudo snap install code-insiders --classic. Insiders builds include preview features and update daily. Both versions can run simultaneously.

How do I run VSCode as root on Ubuntu?

Run sudo code --user-data-dir="~/.vscode-root" from Terminal. VSCode blocks root execution by default for security. A separate user data directory prevents permission conflicts with your normal codebase.

What extensions should I install after setting up VSCode on Ubuntu?

Start with language-specific extensions: Python, ESLint for JavaScript, or C/C++ for system programming. Add GitLens for configuration management visibility. The extension marketplace offers thousands more based on your workflow.

Conclusion

You now know how to install VSCode on Ubuntu using the .deb package, Microsoft's apt repository, or the Snap store. Each method gets you to the same result.

The dpkg command works for offline setups. The repository method handles software updates automatically through apt-get.

Your next steps matter more than the installation itself. Configure your workspace settings, install language extensions, and set up continuous integration workflows.

VSCode handles everything from syntax highlighting to remote development and debugging tools. It works with Node.js, Python, JavaScript, TypeScript, and dozens of other languages out of the box.

The integrated terminal and Git support turn it into a complete development environment. No additional desktop applications required.

50218a090dd169a5399b03ee399b27df17d94bb940d98ae3f8daff6c978743c5?s=250&d=mm&r=g How to Install VSCode on Ubuntu: Step-by-Step
Latest posts by Bogdan Sandu (see all)

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.