sudo apt update
sudo apt install software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt update
sudo apt install code
Last active
January 21, 2026 23:40
-
-
Save codedeep79/49ac6e9d30785e2284e3761d7d65f829 to your computer and use it in GitHub Desktop.
Install Visual Studio Code in Ubuntu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

It will add microsoft's key to the
/etc/apt/trusted.gpg.ddirectory, which is insecure.Instead, you should put the
microsoft.gpgin a memorable place such as/usr/share/keyrings/or/etc/apt/keyrings/and then addSigned-Bymetadata to your.listor.sourcesfile (whichever you are using).(The
.listand.sourcesfiles are located in/etc/apt/sources.list.d/, if you were not aware)Your
vscode.listshould look like:But actually the
.sourcesformat is now preferred to the.listformat.Here's what my
vscode.sourcesfile looks like: