How to install visual studio code on ubuntu 24. 04

How To Install Visual Studio Code on Ubuntu 24.04

For building and debugging web and cloud applications, several code editors are available, but only some of them are worth a try. One of them is Visual Studio Code, which is known for its versatility, extensibility, and developer-friendly features. It is supported on almost all Linux distributions, including the newly released Ubuntu version which is 24.04. To install it on Ubuntu 24.04 there are multiple ways to be discussed in this guide.

Outline:

How To Install Visual Studio Code on Ubuntu 24.04

Visual Studio Code stands out among other code editors because it is free, and comes with the availability for a wide range of extensions. Moreover, it comes with features like autocompletion, syntax highlighting, and code navigation for various programming languages. To install it on Ubuntu 24.04 here are some ways that can be followed:

1: Through the Snap Package installer

The third-party package installers come into play when the package or application is not available in the Ubuntu default installer. The Snap package installer provides the classic version of Visual Studio Code, to install it execute:

sudo snap install code –classic

How to install visual studio code on ubuntu 24. 04 1

To verify the installation of VS Code on Ubuntu, check the list of applications installed via the Snap package manager:

sudo snap list

How to install visual studio code on ubuntu 24. 04 2

Now to launch the Visual Studio Code editor, execute the below command or look for it in the applications menu:

See also  How to Install TupiTube Desk on Ubuntu 20.04 LTS
code

How to install visual studio code on ubuntu 24. 04 3

2: Through VS Code Repository

Since the VS Code is not available in the default package installer, so in that case if you want to use apt for installation then you need to add its repository from Microsoft. For that first, you need to install some utility tools which include software-properties-common, apt-transport-https, and wget:

sudo apt install software-properties-common apt-transport-https wget

You can skip this step if you already have installed all these utilities:

How to install visual studio code on ubuntu 24. 04 4

Now add the signing key for the Visual Studio Code and for that download the microsoft.asc file which will add its contents as GPG file in the Ubuntu keyring system:

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add

How to install visual studio code on ubuntu 24. 04 5

Now verify if the GPG key is added to the keyring system by listing all the saved keys:and before that update the package list for apt:

sudo apt-key list

How to install visual studio code on ubuntu 24. 04 6

Now add the Visual Studio Code repository by Microsoft using the apt-add-repository command:

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

How to install visual studio code on ubuntu 24. 04 7

Next, update the system package list and install the VS Code editor using apt:

sudo apt install code -y

How to install visual studio code on ubuntu 24. 04 8

Now just to be sure about the installation, check the version of the code editor installed:

code –version

How to install visual studio code on ubuntu 24. 04 9

To launch this code editor on Ubuntu there are two ways one is by CLI and the other is by GUI so to launch through GUI search for Visual Studio in the applications menu:

See also  Ways to Check SSD or HDD in Linux OS

How to install visual studio code on ubuntu 24. 04 10

3: Through Deb File

If you are looking for the latest version of Visual Studio Code then this method is recommended for its installation. This is because deb files are mostly found on the application’s official website so to download the deb file for Visual Studio Code there are two ways one is by visiting its official website:

Sponsored

How to install visual studio code on ubuntu 24. 04 11

Or using the download link along with the wget utility:

Wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/019f4d1419fbc8219a181fab7892ebccf7ee29a2/code_1.87.0-1709078641_amd64.deb

How to install visual studio code on ubuntu 24. 04 12

Next, use the apt package manager to install it on Ubuntu 24.04, by either navigating to the file location or adding the file location in the installation command:

sudo apt install ./code_1.87.0-1709078641_amd64.deb

How to install visual studio code on ubuntu 24. 04 13

Now launch the Visual Studio Code by executing:

code

How to install visual studio code on ubuntu 24. 04 14

4: Through App Center

To install applications on Ubuntu there is an application center also known as the GNOME software application. Visual Studio can also be installed on Ubuntu through it, this method is beneficial for users who are not familiar with the command line interface of Ubuntu. So to install VS Code launch the Application Center and search for Slack in the explore tab, next click on Install:

How to install visual studio code on ubuntu 24. 04 15

Once the installation is complete, you can either click on the Open option or launch it from the applications menu later:

How to install visual studio code on ubuntu 24. 04 16

How To Remove Visual Studio Code From Ubuntu 24.04

The process for removal of any application on Ubuntu primarily depends on the method adopted for its installation, so if Visual Studio is installed via Snap package installer then uninstall it by executing:

sudo snap remove code

How to install visual studio code on ubuntu 24. 04 17

Now if you have either used the deb file or Microsoft Visual Studio repository for installation then in that case execute:

sudo apt remove –autoremove code

How to install visual studio code on ubuntu 24. 04 18

To remove this code editor completely from Ubuntu in case the repository is use you need to first remove the GPG key saved in the keyring system. For that first copy the key by listing all the keys and then use the del command to delete it:

sudo apt-key del BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF

How to install visual studio code on ubuntu 24. 04 19

Next, remove all the repositories associated with the VS Code saves in the sources directory and afterward update the packages list:

sudo rm archive_uri-https_packages_microsoft_com_repos_vscode-noble.list

sudo rm vscode.list

How to install visual studio code on ubuntu 24. 04 20

To install VS Code if installed via App Center search for it in the App Center and click on Uninstall in the meatball menu:

How to install visual studio code on ubuntu 24. 04 21

Conclusion

Visual Studio Code is a versatile code editor that comes with a number of features which include Git integration, an integrated terminal with the editor, live share, and rich support for programming languages.

To install Visual Studio Code on Ubuntu 24.04 there are four ways which include using Snap Package manager, deb file, VS Code repository, and Ubuntu App Center. The recommended way for installing Visual Studio Code on Ubuntu is by using its deb file which can be downloaded from its official website.


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply