1

I shifted to Ubuntu 20.04 LTS 3 weeks ago from Windows 10. I use Visual Studio Code and whenever I get an update in Update it shows in Settings > Download Update(1). When I click on download update, firefox opens up and then I have to download Visual Studio Code Setup from there and then I have to install it. This is what I have to do everytime. In Windows, I just had to click the Download Update button then the update would automatically be downloaded.

Please tell me if there is any way to update Visual Studio Code easily like using termianl?

Thanks in Advance

PS: Sorry for my bad English as it's not my native language, I may have committed some grammatical mistakes.

NoobCodeTyper
  • 21
  • 1
  • 5
  • Did you install it from a download or the PPA? – rtaft Oct 15 '20 at 13:12
  • I installed it using the downloaded the .deb file from the official website and then installed it using 'sudo dpkg -i' – NoobCodeTyper Oct 15 '20 at 14:03
  • 1
    Does this answer your question? [How can I update Visual Studio Code on Ubuntu?](https://askubuntu.com/questions/833448/how-can-i-update-visual-studio-code-on-ubuntu) – karel Oct 15 '20 at 14:24

4 Answers4

3

After installing, you should have the following file: /etc/apt/sources.list.d/vscode.list with this content:

deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main

This will allow you to update it with apt

sudo apt update
sudo apt upgrade
rtaft
  • 1,790
  • 3
  • 13
  • 26
  • 1
    `sudo apt upgrade` will upgrade the Ubuntu OS as well? Not just VS Code. Isn't it ? The question is about how to upgrade VS Code only. – Muhammad Tariq Feb 05 '21 at 06:15
0

Assuming you've installed snapd package using $ sudo apt install snapd. First remove all other(.deb) version(s) of VSCode, then run:

$ sudo snap install code --classic

This installs VSCode which automatically gets updated but if you like to manually check and trigger an update, run:

$ snap refresh
0

In my case it was not a straight forward upgrade. I tried to upgrade VS Code with the following commands

sudo apt install apt-transport-https
sudo apt update

and I got the following error

enter image description here

Then I used the following process to upgrade VS Code.

  • Downloaded the .deb file from website
  • Executed following command sudo dpkg -i <file>.deb & sudo apt-get install -f # Install dependencies
  • Executed the commands in the sequence sequence
  • 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'
  • Then update the package cache and install the packages
  • $ sudo apt install apt-transport-https
  • $ sudo apt update
  • $ sudo apt install code # or code-insiders

and DONE.

Ref: https://code.visualstudio.com/docs/setup/linux

Final Screenshot
enter image description here

0

I've updated only VS Code, not all installed packages, by:

sudo apt update
sudo apt-get --only-upgrade install code