Jump to content

Install vscode on Ubuntu 24.04


Recommended Posts

As a developer, your life is easier when you have your favorite tools. Now that Ubuntu 24.04 is around, one to-do involves installing all the developer tools you require, including Microsoft’s Vs Code.

Ubuntu supports vscode, and there are different options you can use to quickly install vscode on Ubuntu 24.04 and start using it for your coding. Read on as this post shares three practical installation methods for any user.

How to Install vscode on Ubuntu 24.04

It’s undeniable that vscode is a favorite code editor among developers. That doesn’t come as a surprise considering the numerous options that vscode offers, from plugins to version control. All these features are only accessible after you install vscode.
You can install vscode via a command line or GUI. We’ve covered the different options below. This way, go through the options and see which suits your case.

Method 1: Installing vscode via Snap

Ubuntu uses the App Store, where you can source its snap packages and install them. Vs Code is available as a snap package, and the benefit of installing it this way is that you don’t need to install its dependencies separately.

A snap bundles all packages. It requires ensuring that once you run the install command, vscode will install alongside its dependencies, and only one command is needed.
Although installing vscode as a snap is possible, you won’t get its latest version. Nonetheless, you will get a stable version and only need to execute the following command.

$ sudo snap install --classic code
install-vscode-1.png

You will get a window showing the progress bar for the running process, from downloading the snap package to installing it.

Method 2: Install vscode on Ubuntu 24.04 via Snap GUI

Our first method explains how to source vscode from the App Center and install it via the command line. Even for this method, we are still sourcing vscode from the snap store but using the GUI approach. Use the below steps to get it done.
Step 1: On your Ubuntu 24.04, search for App Center from your applications and tap on it to open it.

install-vscode-3.png

Step 2: On the App Center window, click on the Search icon at the top and type vscode and press the search button.

install-vscode-4.png

Step 3: Once vscode appears in the search results, tap on it. Next, click the Install button.

install-vscode-5.png

Step 4: Authenticate the installation by entering your password when prompted.

install-vscode-6.png

Step 5: That’s it. Vs Code will start installing, and a progress bar will show the progress. Once it completes installing, you can start using vscode for your code.

Method 3: Install vscode on Ubuntu 24.04 via APT

APT is a Ubuntu package manager that allows users to source packages from the Ubuntu repository and other repositories, install them, and manage them. Even when you want to install vscode, it’s possible to use APT.
However, Ubuntu 24.04 doesn’t come with vscode in its repository. You can verify this by trying to install vscode via APT using the following command.

$ sudo apt install code

Notice the error we get: It only shows that vscode can be installed as a snap package, which we already did.

install-vscode-7.png

The solution is to add the vscode repository to your Ubuntu 24.04 repository and then install it. To do this, let’s follow the below steps.
Step 1: The first step is to update your Ubuntu 24.04 package list to prepare it to receive the vscode repository. Run the following update command.

$ sudo apt update
install-vscode-8.png

Step 2: We must install some required dependencies to ensure the installation runs softly.

$ sudo apt install software-properties-common apt-transport-https wget -y
install-code-9.png

Step 3: Microsoft offers a GPG key to help verify the vscode code repository before you add it. Source the GPG key and add it with the below command.

$ wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
install-vscode-15.png

Step 4: It’s time we added the vscode repository using the below command.

$ sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

After running the command, different prompts will appear. Confirm them to complete adding the repository.

install-code-11.png

Step 5: That’s it. You can now install vscode on Ubuntu 24.04 using the Apt command.

$ sudo apt install code
install-code-12.png

Conclusion

Vs Code is a commonly used code editor, and if you recently upgraded or installed Ubuntu 24.04, knowing how to install it easily saves you time. Luckily, this post has shared three approaches you can follow depending on your preference. Happy coding!

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...