Message while installing chocolatey [closed]
Asked Answered
R

4

12

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?

Robot answered 12/2, 2021 at 6:23 Comment(0)
G
48

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!

Garrett answered 13/2, 2021 at 20:4 Comment(4)
Thank you! btw, if the command doesn't work for you just navigate to the folder location and delete the chocolatey folderLongwinded
Surprisingly enough this isn't mentioned anywhere on the Chocolatey site. When installing, I get the message saying to use choco upgrade but then getting choco isn't a recognized cmdlet seems to be rather difficult to search when getting two conflicting errors.Aram
I didn't had the sufficient right to run such command. But deleting the file manually did work for meImmure
Deleting the chocolatey folder manually worked for me, thanks!Romanfleuve
F
7

I deleted manually C:\ProgramData\chocolatey directory then launched the command again

Furnishing answered 23/10, 2021 at 18:32 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Mixologist
This answer might be short and small, but actually helped me install Chocolatey on my machine. If you get the OP's error message, I recommend deleting whatever folder it says "already exists" and re-running the command.Dulcine
R
3

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

Restive answered 4/7, 2022 at 14:9 Comment(0)
R
0

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:

  • Backup the files at the path listed above so you can restore your previous installation if needed
  • Remove the existing installation manually
  • Rerun this installation script
  • Reinstall any packages previously installed, if needed (refer to the lib folder in the backup)

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:

Reamonn answered 16/7, 2023 at 12:43 Comment(2)
Welcome to Stack Overflow! It feels like you copied parts of this from somewhere else. It also doesn't appear to be any different from two of the other answers here, with the exception that you answer recommends backing up before removing the folder. This would be more appropriate as an edit or comment to the existing answers, rather than a new answer itself.Macintosh
If any part of the answer were copied from elsewhere, please make sure to include a link to where you found it. Or, if the source was an AI-tool such as ChatGPT, you should delete it, as posting of AI-generated content is not permitted on Stack Overflow. Thanks!Macintosh

© 2022 - 2024 — McMap. All rights reserved.