Disabling VSCode autoupdate on linux machines

Viewed 134

Suggestions provided here to disable autoupdate of VSCode apply only to MacOS and Windows. I have a linux machine on which VSCode updated itself today to Version 1.60.0

Although it does not apply, I nonetheless had

"update.mode": "none"

in the user settings.json file.

This question has been asked before on SO. See How do I disable VS Code of updating itself?, but it does not appear to work on linux.

This documentation from VSCode specifically for linux states:

If the VS Code repository was installed correctly, then your system package manager should handle auto-updating in the same way as other packages on the system.

How exactly should one go about disabling auto updates for linux? Does the above quote mean that on linux either all packages are auto updated or none of them are? I am on Ubuntu 20.10

2 Answers

Okay Google suggests:

  • Open the Unity Dash (16.04) or App Launcher (18.04+)
  • Search for 'Software & Updates'
  • Select the 'Updates' tab.
  • Change 'Automatically check for updates' from 'Daily' to 'Never'.

I don't have ubuntu at my office or i would test. I'll make sure when I get home if you haven't tried by then.

The reason VS Code in Linux still updates despite the settings is because the app is not handling the updating. In Linux, the package manager handles it. In Linux Mint (and Debian, Ubuntu) at least, the update is being done with apt. Other Linux distros have different package mangers, like Yum for RedHat based systems.

The way to disable the updating of VS Code is to remove the repository check that's created when VS Code is installed. In Linux Mint the location is:

/etc/apt/sources.list.d/vscode.list

This file has one repo listed:

deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main

To stop updating, simply comment out the line by adding a hash (#) in front of 'deb'

The proper way to do this would [probably] be to remove the repo using apt, but I prefer to keep the list file and repo available to make it simple to replace should I wish to enable auto-updating in the future. To start updating again, simply remove the hash and save the file.

Updating can still be done from VS Code after it's disabled in the package manager. To update VS Code manually, from the About menu select "check for updates" and then download and install if updates are available.

If you have set updates to "none" in settings, Check for updates does not show in the menu. You can get this menu item back by changing the setting for updates to "Manual".

Related