Song Yang
Song Yang

Reputation: 485

How to update vcpkg itself?

I have installed vcpkg, a package manager for C++. Now after some time, I'd like to update it. How can I do that? Do I need to uninstall and reinstall?

Upvotes: 9

Views: 18487

Answers (4)

Song Yang
Song Yang

Reputation: 485

The vcpkg community on Github provided an official answer on their FAQ. They suggest pulling the repo and running the bootstrap script.

Upvotes: 5

dwc035
dwc035

Reputation: 1

"git pull" "./bootstrap-vcpkg.bat"

This downloads current binary of .EXE - but doesn't change your installed packages. No need to delete / reinstall any packages.

You can then "vcpkg update/upgrade" for installed pkgs as you wish.

Upvotes: 0

Bobbie E. Ray
Bobbie E. Ray

Reputation: 834

Given the previous/sufficient answers, this might be a tad redundant, but I usually go in this order (on my Windows machine)

  1. Open PowerShell, go to the vcpkg root directory and run .\vcpkg --version to check the version no. You can check the git to see whether there's a more recent version.
  2. To update, stay in the directory and run git pull https://github.com/microsoft/vcpkg. This runs git fetch to get files from the remote repository and runs git merge to merge the changes.
  3. Then run ./bootstrap-vcpkg.bat to update vcpkg

Upvotes: 3

Alexander Neumann
Alexander Neumann

Reputation: 2028

The best way to update a vcpkg git clone is to do

  • save a list of all installed ports somewhere
  • git pull
  • delete the <vcpkg_root>/installed/ directory
  • rerun bootstrap.bat or bootstrap.sh
  • reinstall all ports:triplets you need

Note:

  • there is a vcpkg upgrade/update command but it is discouraged since it is not transactional
  • in general you don't need to run re integrate but sometimes it is necessary vcpkg integrate remove/install

Upvotes: 13

Related Questions