Перейти к содержимому

Как обновить visual studio code

  • автор:

How to update to the latest release

The following shows you how to update to the latest release of Visual Studio Code.

Note: For Mac and Windows users, we have enabled the auto-update channel. If you’re prompted by VS Code, accept the newest update and it will get installed (you won’t need to do anything else to get the latest bits).

Auto-updates are not supported for Linux.

Updating on Linux

  • Download the VS Code zip file: 64-bit or 32-bit.
  • Open the zip and run Code

Updating on OS X

You need to do this only if auto-update did not complete.

  • Download the VS Code zip file from here.
  • Open the zip file and drag Code over to Applications.
  • Launch Code.

Updating on Windows

You need to do this only if auto-update did not complete.

Important: Close any running instances of VS Code before attempting to update (to avoid VS Code not being able to start after you update).

  • Run the installer from here.
  • If you have trouble with the Windows installer, download the VS Code zip file from here.

Common Questions

Q: How do I know which version I’m running?

A: In Linux and Windows, choose Help, About. In OS X, use Code, About Visual Studio Code.

Q: What are the supported operating system versions needed to run Visual Studio Code?

How to Update Visual Studio Code (Force an Update)

This guide shows how to update Visual Studio Code to the latest release. We’ll intentionally use an older version of VS Code (1.63.2) for this tutorial.

How to check for a new update

By default, Visual Studio Code automatically checks for new updates. If you would like to perform a manual check for a new update, follow these steps:

    Launch VS Code. From the “Help” menu, select Check for Updates…

Check For Updates

No Updates

How to manually force an update

If your update does not automatically complete, you can force an update. Forcing an update requires installing the software again without uninstalling the existing software. Follow these steps:

    First, download the latest version of VS Code for your operating system from code.visualstudio.com.

Download Installer

Release Notes

Using these methods, you can easily keep up with the latest releases of VS Code. You may also want to change your update settings according to your specific needs.

Change your VS Code update settings

There are four different update modes available in Visual Studio Code. Follow these steps to find and change your update configuration:

    From the “Manage” section in the sidebar, select Settings.

Settings

Restart

Check the VS Code version you’re running

Follow these steps to check the version of Visual Studio Code installed in the system:

How To Update Visual Studio Code on Ubuntu

Carlos BradleyBy Carlos Bradley July 25, 2023 July 25, 2023

Ubuntu 6

Visual Studio Code (VS Code) is a popular open-source code editor developed by Microsoft. It offers support for debugging, syntax highlighting, intelligent code completion, snippets, and code refactoring. It’s also highly customizable, allowing users to change the editor’s theme, keyboard shortcuts, and preferences. In this article, we will explore how to update Visual Studio Code on Ubuntu.

To update Visual Studio Code on Ubuntu, you have multiple options. You can manually update it by downloading the new version from the official website and extracting it to the same location. If you installed it using the .deb package, you’ll need to download the new package and use the sudo dpkg -i command to install it. Another option is to set up the official signed repositories, which allows for automatic updates using Ubuntu’s built-in update mechanism. Additionally, Visual Studio Code is available as a Snap package, which will automatically update in the background.

Manual Update

If you’ve installed Visual Studio Code by manually downloading the .tar.gz version from the Visual Studio Code website, you can update it by downloading the new .tar.gz archive and extracting it to the same location. Make sure to keep the old “extensions” folder to preserve your extensions and configurations.

Updating using .deb Package

If you’ve installed Visual Studio Code using the .deb package, you’ll need to download the new .deb package from the Visual Studio Code website every time there’s an update. Once the package is downloaded, open the terminal and navigate to the download location. Use the following command to install the new version:

In this command, dpkg is the package manager from the Debian family of Linux distributions, -i stands for install, and code_downloaded_package.deb is the name of the downloaded package. This command will replace the old version with the new one, but your settings and installed extensions will remain intact.

Updating through Official Signed Repositories

Starting from version 1.10.1, Visual Studio Code provides official signed repositories for Linux. This allows you to set up automatic updates using Ubuntu’s built-in update mechanism. Here’s how to set up the repository:

These commands do the following:

  • curl https://packages.microsoft.com/keys/microsoft.asc | gpg —dearmor > microsoft.gpg downloads the Microsoft GPG public key and saves it to a file named microsoft.gpg .
  • sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg moves the microsoft.gpg file to the /etc/apt/trusted.gpg.d directory, which is where APT, Ubuntu’s package manager, looks for trusted keys.
  • sudo sh -c ‘echo «deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main» > /etc/apt/sources.list.d/vscode.list’ adds the Visual Studio Code repository to your system’s list of repositories.

After setting up the repository, update the package list and install Visual Studio Code with:

Now, whenever you run a system update using sudo apt-get update && sudo apt-get upgrade , Visual Studio Code will be updated along with your system’s other packages.

Updating through Snap Package

Visual Studio Code is also available as a Snap package. Snap is a software deployment and package management system developed by Canonical, the company behind Ubuntu. To install Visual Studio Code as a Snap package, use the following command:

In this command, snap is the Snap package manager, install tells it to install a package, —classic gives the package full access to the system (like a traditionally packaged application), and code is the name of the Visual Studio Code package.

The Snap daemon will automatically update Visual Studio Code in the background, and you’ll receive an in-product update notification whenever a new update is available.

Conclusion

Keeping your software updated is crucial for getting new features, improvements, and security fixes. With Visual Studio Code’s multiple update methods, you can choose the one that best fits your needs and preferences. Whether you prefer manual updates, .deb packages, official repositories, or Snap packages, updating Visual Studio Code on Ubuntu is a straightforward process.

To check the current version of Visual Studio Code installed on your Ubuntu system, open Visual Studio Code and go to the "Help" menu. From there, select "About Visual Studio Code" and a dialog box will appear displaying the version information.

Yes, if you have set up the official signed repositories as mentioned in the article, you can update Visual Studio Code along with your system’s other packages using the software updater. Simply run the command sudo apt-get update && sudo apt-get upgrade in the terminal to update Visual Studio Code and other installed packages.

No, updating Visual Studio Code will not remove your extensions and configurations. However, it is always a good practice to backup your extensions and configurations before updating, just in case. If you are manually updating Visual Studio Code, make sure to keep the old "extensions" folder to preserve your extensions and configurations.

Visual Studio Code releases updates frequently, usually every month or two. These updates include new features, bug fixes, and performance improvements. You can stay up to date by checking the Visual Studio Code website or enabling automatic updates through the official signed repositories or Snap package.

How can I update Visual Studio Code on Ubuntu?

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?

12 Answers 12

The following commands work for me:

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.

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:

Katinka Hesselink's user avatar

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:

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:

Then update the package cache and install the package using:

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

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

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: github.com/moeenz/vscode-updater

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

You can install it by running:

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.

If you get an error message

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

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

Niket Pathak's user avatar

There are two PPAs hosted on GitHub and openSUSE. You can use https://github.com/tagplus5/vscode-ppa before Visual Studio Code has its official PPA.

Follow the steps given below:

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

Install GDebi Package Installer (if not installed).

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.

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.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *