zurfyx
zurfyx

Reputation: 32807

How can I upgrade Visual Studio Code?

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

Answers (11)

bhavesh
bhavesh

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

Rakibul Islam
Rakibul Islam

Reputation: 29

If you have already installed Visual Studio Code, go to the terminal and type two different commands:

  1. sudo apt update
  2. sudo apt-get upgrade code

Upvotes: 2

corngk
corngk

Reputation: 41

This is what I did to avoid the annoying message:

  1. Remove Visual Studio Code, if you already installed it.

    sudo apt-get remove code
    
  2. 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

R. S
R. S

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

marcdahan
marcdahan

Reputation: 3082

  1. 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

  2. then open a terminal in the folder where you downloaded the .deb file and write:

     sudo dpkg -i <the downloaded file>.deb
    
  3. finally, if you have apt-get, do (if not, install apt-get first):

     sudo apt-get install -f
    

Upvotes: 23

L&#234; Vũ L&#226;m
L&#234; Vũ L&#226;m

Reputation: 337

  1. When you install Visual Studio Code with the file .deb on Ubuntu 20.08, first, remove it:

    sudo apt-get remove code
    
  2. 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'
    
  3. Udate the package cache and reinstall

     sudo apt-get install apt-transport-https
     sudo apt-get update
     sudo apt-get install code
    
  4. 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

GigiDev
GigiDev

Reputation: 11

I'm using Kali Linux and this option worked for me:

  1. sudo apt update

  2. sudo apt-get upgrade code

Upvotes: 0

Zeeshan Siddique
Zeeshan Siddique

Reputation: 77

The best way to update Visual Studio Code in Ubuntu:

sudo apt-get update
sudo apt-get install code

Upvotes: 1

Mahadev Gouda
Mahadev Gouda

Reputation: 827

This works fine in Ubuntu:

sudo apt-get update
sudo apt-get install code

Upvotes: 11

Nagev
Nagev

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

zurfyx
zurfyx

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

Related Questions