Install Microsoft Visual Studio Code on Ubuntu:
Just go to the above Microsoft Visual Studio Code download page. And download the latest .deb package file and save it on your Downloads folder. Open the terminal software (ctrl+alt+t) and run below command.
sudo apt install ./Downloads/code*.deb
sudo apt install ./Downloads/code_1.81.1-1691620686_amd64.deb
Note: In the above command “code_1.81.1-1691620686_amd64.deb” is the downloaded file name. You can change above command based on your downloaded file name.
After the successful installation of Microsoft Visual Studio Code, you can open it using below command.
Or click the show apps from the Ubuntu dock and type Visual Studio Code in the search field. Then click Visual Studio Code to open it.
Install Visual Studio Code via Snap:
You can also install Visual Studio Code via snap package file. In the terminal run below command.
sudo snap install code --classic
Install Visual Studio Code via Flatpak:
You can install Visual Studio Code via below flatpak install command.
flatpak install flathub com.visualstudio.code
After the installation, you can open it using below command.
flatpak run com.visualstudio.code
And you can also uninstall it using below commands.
flatpak uninstall com.visualstudio.code
sudo flatpak uninstall com.visualstudio.code
Note: you need flatpak and flathub on your system before installing Visual Studio Code. If you don’t have flatpak and flathub, then install it using below commands and restart your system after installation it.
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo