How to Install Visual Studio Code on Linux Mint 20.04

Linux Mint versions earlier than 20.04 would allow a user to install snapd, prior to adding snap applications. Current version of Mint has this utility explicitly disabled.

Here’s a work-around (that turns out to be ineffective as of Jan 10, 2021):

# Enable snapd on Linux Mint 20 (required) prior to adding vscode
sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt update
sudo apt install snapd
sudo snap install code --classic

Recommended method from https://code.visualstudio.com/docs/setup/linux

# Add repository key
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'

# Installing code from included repo
sudo apt install apt-transport-https
sudo apt update
sudo apt install code

Previous instructions that would not work on Mint 20.04

sudo apt -y 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 -y install code
Configurations:
# Configure autosave
File > Preferences > Settings > set 'File: Auto Save' = onWindowsChange

# Change tab settings
File > Preferences > Settings > set 'Editor: Tab Size' = 2

# Manually edit extensions
File > Preferences > Settings > Extensions > Scroll down and find “Edit in settings.json”

# Add PowerShell Extension:
click on the Extentions icon (the four squares) > search for ‘powershell’ > select and install
Miscellaneous:
# Install Visual Studio Code
# Add repository key
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt install apt-transport-https # Installing code from included repo
sudo apt update
sudo apt install code
code --install-extension wmaurer.change-case
code --install-extension ms-vscode.powershell-preview
code --install-extension ironmansoftware.powershell-universal


# Install DotNet Core 3.1 SDK (which also includes runtime)
osversion=$(lsb_release -sr)
wget https://packages.microsoft.com/config/ubuntu/$osversion/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-3.1

# Install PowerShell
sudo apt-get update -y
sudo apt-get install -y wget apt-transport-https software-properties-common
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update -y
sudo add-apt-repository universe
sudo apt-get install -y powershell

# Install DotNet Core 3.1 SDK (which also includes runtime)
sudo su # enter root first
osversion=$(lsb_release -sr)
wget https://packages.microsoft.com/config/ubuntu/$osversion/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-3.1
Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *