bassouat
bassouat

Reputation: 326

Message while installing chocolatey

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

Answers (4)

Monyker
Monyker

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

santosh
santosh

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:

  • 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:

Upvotes: 0

BLESSING VICTOR
BLESSING VICTOR

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

elie
elie

Reputation: 309

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

Upvotes: 8

Related Questions