Glam Prestige Journal

Bright entertainment trends with youth appeal.

I downloaded the .tar.gz version of VS Code for Ubuntu (64-bit) and have been able to run it smoothly for some time. Some extensions have been installed too.

How can I efficiently update this VS Code installation? One thing I can think of is to just download the new .tar.gz archive and extract to the same location, just keeping the old "extensions" folder.

If I use the .deb version, would the same process be needed? Would I download the new .deb every time there is an update?

7

11 Answers

The following commands work for me:

wget ' -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.

5

Updated answer October 2021:

If you installed the software using the .deb file you don't have to download the package manually. You can just do:

sudo apt update
sudo apt install code

Thanks to @MuhammadSheraz


Old answer:

sudo apt-get update
sudo apt-get install code 

source:

10

Vladimir S. posted the correct solution, although he originally didn't link directly to the section that had the answer. The direct link is here.

For those who'd rather not click, here's the official solution per Microsoft:

Debian and Ubuntu based distributions

The easiest way to install for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit) either through the graphical software center if it's available or through the command line with:

sudo dpkg -i <file>.deb
sudo apt-get install -f # Install dependencies

Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the regular system update mechanism (apt update). Note that 32-bit and .tar.gz binaries are also available on the download page.

The repository and key can also be installed manually with the following script:

curl | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] stable main" > /etc/apt/sources.list.d/vscode.list'

Then update the package cache and install the package using:

sudo apt-get update
sudo apt-get install code # or code-insiders
2

In true Microsoft style, they decided to call the package just code. So download the latest .deb and:

sudo dpkg -r code
sudo dpkg -i code_downloaded_package.deb

Configuration files, installed extensions and even currently used folder are preserved.

1

Since version 1.10.2, Visual Studio Code has got the official signed repositories for Linux. Please look here.

Use the script available in this repository:

According to the issue Setup apt repository to enable OS-level updating on Debian-based systems #2973, the official PPA is still in progress.

There are two PPAs hosted on GitHub and openSUSE. You can use before Visual Studio Code has its official PPA.

Snap

Visual Studio Code is officially distributed as a Snap package in the Snap Store:

You can install it by running:

sudo snap install --classic code # or code-insiders

Once installed, the Snap daemon will take care of automatically updating VS Code in the background. You will get an in-product update notification whenever a new update is available.

Source:

1

If you get an error message

code is already the newest version (x.xx.x-xxxxx)

The simplest solution is to download the latest binary from the Official Source and then install it by executing the following:

sudo apt install /home/xyz/Downloads/code_x.xx.x-xxxxxxx.deb

This will reinstall code over the older version. Your settings and installed extensions will remain unchanged as expected.

Reference

1

Follow the steps given below:

  1. Download the latest version of Visual Studio Code as a .deb package.

  2. Install GDebi Package Installer (if not installed).

  3. Then remove Visual Studio Code (older version) by opening its .deb package (which you downloaded earlier) using GDebi Package Installer and then click on "Remove Package" option.

  4. Then open the .deb package of the latest version of Visual Studio Code using GDebi Package Installer and click "Install Package" and install latest version of Visual Studio Code.

All your configurations (packages installed and other customisations) in Visual Studio Code which you did earlier will be restored automatically even after following the above procedure. So you need not worry about installing the packages again. You will find those customisations and packages automatically in the latest version you have installed.

Updating through this procedure doesn't remove/purge configuration files of Visual Studio Code and that's why, all your configurations in Visual Studio Code are restored.

This procedure works also for other code editors, like Sublime Text 3 and Atom. I have myself tested and verified it.

Get the .deb file from and run it from system package manager. Here's the official source link.