Reputation: 32807
What's the best way to upgrade Visual Studio Code on Ubuntu?
For the time being, I was periodically getting the newest version (.deb) from their official site:
sudo dpkg -i code_*.deb
Upvotes: 70
Views: 183543
Reputation: 755
The following commands work for me (for Linux):
wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
Place those two commands into an executable Bash script called auto-update-VSCode, and you can simply run that from your shell any time Visual Studio Code says it's out of date.
Upvotes: 4
Reputation: 29
If you have already installed Visual Studio Code, go to the terminal and type two different commands:
sudo apt update
sudo apt-get upgrade code
Upvotes: 2
Reputation: 41
This is what I did to avoid the annoying message:
Remove Visual Studio Code, if you already installed it.
sudo apt-get remove code
Add repositories, update and install:
sudo add-apt-repository -y "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main "
sudo apt update
sudo apt -y install code
Upvotes: 3
Reputation: 21
I'm running Ubuntu 20.04 (Focal Fossa), and this worked perfectly for me:
wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
Upvotes: 2
Reputation: 3082
download the latest Visual Studio Code (.deb) package to your computer on this link:
https://go.microsoft.com/fwlink/?LinkID=760868
, or this there: Getting Started
then open a terminal in the folder where you downloaded the .deb file and write:
sudo dpkg -i <the downloaded file>.deb
finally, if you have apt-get, do (if not, install apt-get first):
sudo apt-get install -f
Upvotes: 23
Reputation: 337
When you install Visual Studio Code with the file .deb on Ubuntu 20.08, first, remove it:
sudo apt-get remove code
Add the repository in this link https://code.visualstudio.com/docs/setup/linux
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 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Udate the package cache and reinstall
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code
In the next time when you want to upgrade, just do:
sudo apt-get update
sudo apt-get upgrade code
Because your repository is missing information to upgrade Visual Studio Code, the above solution will fix it.
Upvotes: 8
Reputation: 11
I'm using Kali Linux and this option worked for me:
sudo apt update
sudo apt-get upgrade code
Upvotes: 0
Reputation: 77
The best way to update Visual Studio Code in Ubuntu:
sudo apt-get update
sudo apt-get install code
Upvotes: 1
Reputation: 827
This works fine in Ubuntu:
sudo apt-get update
sudo apt-get install code
Upvotes: 11
Reputation: 13315
If you have installed it via the repository, exit Visual Studio Code, and then just do:
sudo apt update
sudo apt install code
This is the same command to install or upgrade to the latest version. You can see the version with:
code --version
Now the easiest and recommended way is to use snap:
sudo snap install --classic code
And updates are supposed to be automatic.
Upvotes: 23
Reputation: 32807
Visual Studio Code enabled official Linux repositories on February 2017 (v1.10)
sudo add-apt-repository -y "deb https://packages.microsoft.com/repos/vscode stable main "
sudo apt update
sudo apt -y install code
You can upgrade / dist-upgrade as usual
sudo apt -y upgrade
sudo apt -y dist-upgrade
Upvotes: 98