Force reinstall of all chocolatey packages after profile "migration"

1

For various reasons, my Windows user profile has been recreated; and - AppData files have been copied into the new profile, but not registry contents.

Now, I'm trying to restore the installation state of my chocolatey-installed apps. The thing is, when I try to choco install foo, I get a message saying:

foo v1.2.3 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.

How can I force a reinstall of all installed apps?

einpoklum

Posted 2019-12-12T12:27:15.177

Reputation: 5 032

@vssher - You should submit a detailed answer instead of submitting a temporary comment. – Ramhound – 2019-12-12T13:17:51.097

@vssher: That doesn't reinstall anything. – einpoklum – 2019-12-12T13:49:28.570

Answers

1

It seems this should work:

choco upgrade all --force

... and remember to execute this in a Powershell opened with "Run As Administrator".

Edit: If any of the installations fail (which occasionally happens ), I don't know how to continue with just the remaining re-installations rather than all of it together. So, more robust solutions would be very welcome.

einpoklum

Posted 2019-12-12T12:27:15.177

Reputation: 5 032