3

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

Tryer
  • 3,580
  • 1
  • 26
  • 49
  • Which package manager are you using? Ubuntu has a bunch of options for it. And yes, the PM should be auto updating by default, or if you run an update before installing something new, etc. – Clayton Engle Sep 03 '21 at 16:55
  • I originally installed VSCode on this machine via the default "Ubuntu Software". When I go to the same app, and search for VSCode, there is a green check mark next to it which indicates that VSCode is installed. There is no option to right click there and disable auto updates, etc. – Tryer Sep 03 '21 at 17:03
  • Ah, OK. In their installer. I'll look and see if I can find it, if someone doesn't beat me to the punch. – Clayton Engle Sep 03 '21 at 17:05
  • Unless you installed VScode to your `/home/you` directory somewhere, then a Linux system should not be capable of updating unless the update process runs with `UID == 0` or `EUID == 0` (e.g. `root`). What I do is simply not update the code repository until I have checked github and decided I want the update. I use the C/C++ `.vsix` offline installer for the extensions, so nothing can update until I explicitly grant root privileges for VScode or choose to download the updated C/C++ extension. (that's a work-around to consider) – David C. Rankin Sep 03 '21 at 17:18
  • @DavidC.Rankin Please see image https://imgur.com/f9gDnsp of what I get on my machine. It appears that VSCode is a snap package install. My installation of VSCode was fully default settings via "Ubuntu Software" and did not involve changing any default settings. – Tryer Sep 03 '21 at 17:31
  • On Ubuntu, the update doesn't happen until after you `apt-get update` and `apt-get upgrade`. If VScode isn't is the basic repositories (configured in `/etc/apt/sources.list` or individually in `/etc/apt/sources.list.d`) If you have a separate repo for VScode anywhere there, you can disable the repository to prevent auto update (and enable it when you want to update) I looked at your image, but I've never used a GUI to configure Linux, so it doesn't tell me a whole lot except it looks like you have disabled what needs to be disabled. – David C. Rankin Sep 03 '21 at 17:39
  • You may also try [AskUbuntu](https://askubuntu.com/) – David C. Rankin Sep 03 '21 at 17:42
  • Done! https://askubuntu.com/questions/1361770/disabling-vscode-autoupdates-on-ubuntu-20-10 Also, I checked and figured out that vscode does not appear in sources.list or sources.list.d – Tryer Sep 03 '21 at 18:00

2 Answers2

0

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.

Clayton Engle
  • 582
  • 3
  • 17
  • 1
    Neither of these apps are there on Ubuntu 20.10. What is there is a "Software and Updates" -- see link https://imgur.com/f9gDnsp . It seems that installing VSCode via "Ubuntu Software" makes it a snap package and thereby leading to automatic updates. The question now is, how can I selectively disable auto update of certain snap packages. Thanks for your suggestion. – Tryer Sep 03 '21 at 17:26
  • Yeah that's far out of my domain. Good luck though. I've got an Ubuntu cloud server in my basement and trying to learn that between contracts, but it craps out a lot so I'm not getting far haha – Clayton Engle Sep 03 '21 at 17:28
0

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

Mark
  • 229
  • 3
  • 9