Ubuntu

How To Install Visual Studio Code on Ubuntu 24.04

visual studio code in 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

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

sudo snap list

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

code

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:

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 -

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

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"

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

sudo apt install code -y

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

code --version

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:

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:

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

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

Now launch the Visual Studio Code by executing:

code

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:

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

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

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

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

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

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

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.

Similar Posts