how do you specifically install VS Code in WSL 2 using Ubuntu distro. It seems it doesn't work for me. Visual Studio Code is officially distributed as a Snap package in the Snap Store. However, when I try to run:
sudo snap install --classic code # or code-insiders
And then, this happen to me:
Because of this, I have one option, and since I am using Ubuntu, the easiest way to install Visual Studio Code for Ubuntu based distributions is to download and install the .deb package (64-bit), either through the graphical software center if it's available, or through the command line with:
sudo apt install ./<file>.deb
sudo apt install apt-transport-https
sudo apt update
And it is working pretty fine for me, and it was installed and updated correctly:
For sudo apt install ./<file>.deb
:
For sudo apt install apt-transport-https:
For sudo apt update:
However, the final requirement based on the documentation is to run:
sudo apt install code
But this doesn't work for me as I always receiving this error:
E: unable to locate package code
Am I missing on the documentation? You can check it out here: https://code.visualstudio.com/docs/setup/linux. I am pretty sure I followed the documentation correctly but It doesn't work for me so I actually missed something, maybe out of the documentation.