6

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?

Song Yang
  • 407
  • 5
  • 14

3 Answers3

8

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
Alexander Neumann
  • 1,479
  • 8
  • 17
5

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

Song Yang
  • 407
  • 5
  • 14
3

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
Bobbie E. Ray
  • 635
  • 7
  • 8