Reputation: 326
i am installing Chocolatey on my computer by using powershell,but when i type this command on powershell as an admin:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
I get this message:
An existing Chocolatey installation was detected. Installation will not continue.
For security reasons, this script will not overwrite existing installations.
Please use choco upgrade chocolatey to handle upgrades of Chocolatey itself.
I don't understand why it said there is an existing chocolatey installation,how should i fix it and keep installing chocolatey on my computer?
Upvotes: 18
Views: 50844
Reputation: 731
I ran into this today, on a system that apparently had a borked Chocolatey installation. This worked for me; your mileage may vary:
Remove-Item C:\ProgramData\chocolatey -Recurse -Force
If you encounter an access/permissions-related error, make sure PowerShell/Terminal/Command Prompt is running as administrator! Then run the Chocolatey installation command again. Hope that's helpful!
Upvotes: 63
Reputation: 1
WARNING: 'choco' was found at 'C:\ProgramData\chocolatey\bin\choco.exe'. WARNING: An existing Chocolatey installation was detected. Installation will not continue. For security reasons, this script will not overwrite existing installations.
Please use choco upgrade chocolatey to handle upgrades of Chocolatey itself. If the existing installation is not functional or a prior installation did not complete, follow these steps:
Once installation is completed, the backup folder is no longer needed and can be deleted. Chocolatey v2.1.0 Upgrading the following packages: python;visualstudio2019-workload-vctools By upgrading, you accept licenses for the packages. python v3.11.4 is the latest version available based on your source(s). visualstudio2019-workload-vctools v1.0.1 is the latest version available based on your source(s).
Chocolatey upgraded 0/2 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). Type ENTER to exit:
Upvotes: 0
Reputation: 31
deleting the root folder also helped me, but one of the challenges I encountered was finding the \ProgramData under the C: folder. In my case, the folder was hidden so if you find yourself in this situation. Go to LocalDisk, Click view then mark the Hidden items all hidden will show then you can now see the \ProgramData folder. Hope this help.arrows
Upvotes: 3
Reputation: 309
I deleted manually C:\ProgramData\chocolatey directory then launched the command again
Upvotes: 8