chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.23k stars 897 forks source link

Upgrade has issues when the package is a dependency of other installed packages #98

Closed ferventcoder closed 9 years ago

ferventcoder commented 9 years ago

From @cobrabr - https://github.com/chocolatey/chocolatey/issues/625#issuecomment-73960366 :

I'm running into another issue, however: I'm trying to upgrade Git, but since I have posh-git and Git Extensions, running choco upgrade git shows these messages:

Chocolatey v0.9.9.0 Upgrading the following packages: git By installing you accept licenses for the packages. You have git v1.9.5 installed. Version 1.9.5.20150114 is available based on your source(s) Unable to uninstall 'git 1.9.5' because 'gitextensions 2.48, poshgit 0.5.0.201401009' depend on it.

cobrabr commented 9 years ago

Similar issue with TortoiseGit:

Chocolatey v0.9.9.0 Upgrading the following packages: TortoiseGit By installing you accept licenses for the packages. You have TortoiseGit v1.8.11.0 installed. Version 1.8.12.0 is available based on your source(s) Already referencing a newer version of 'git'.

As suggested by @ferventcoder, I tried running with the --ignore-dependencies parameter, which seems to have worked for TortoiseGit, but didn't for Git.

ferventcoder commented 9 years ago

I think I know what is happening... so the older folder of git had version numbers on it. It's trying to upgrade by removing that folder and moving to git....

ferventcoder commented 9 years ago

@cobrabr try --force and see what happens?

cobrabr commented 9 years ago

Using --force seems to have worked... it's updating right now. Thanks!

Speaking of which: is there a command (or a guideline) to remove the "old" Chocolatey files after installing the new version? My Chocolatey folder is sort of a mess right now... :smile:

kendaleiv commented 9 years ago

I encountered an issue with v0.9.9-rc5 while running choco upgrade all, assuming this might be the same or closely related. It stops further updates from installing, which may or may not be a separate issue.

C:\WINDOWS\system32> choco upgrade all
Chocolatey v0.9.9.0
Upgrading the following packages:
all
By installing you accept licenses for the packages.
git.install v1.9.5.20150114 is the latest version available based on your source(s).
PngGauntlet v3.1.2.2 is the latest version available based on your source(s).
You have autohotkey.portable v1.1.19.02 installed. Version 1.1.19.03 is available based on your source(s)
Unable to uninstall 'autohotkey.portable 1.1.19.02' because 'WinPcap 4.1.3.20141005' depends on it.
kendaleiv commented 9 years ago

Also, I'm not sure what this means, but in case it helps in any way (look for the Already referencing a newer version of 'Ghostscript.app'.):

C:\WINDOWS\system32> choco upgrade cutepdf -y
Chocolatey v0.9.9.0
Upgrading the following packages:
cutepdf
By installing you accept licenses for the packages.
cutepdf v3.0 is the latest version available based on your source(s).

Chocolatey upgraded 0/1 package(s). 0 package(s) failed.
 See the log for details.
C:\WINDOWS\system32> choco upgrade cutepdf -y -force
Chocolatey v0.9.9.0
Upgrading the following packages:
cutepdf
By installing you accept licenses for the packages.
cutepdf v3.0 is the latest version available based on your source(s).
Already referencing a newer version of 'Ghostscript.app'.
C:\WINDOWS\system32> choco upgrade cutepdf -y -force --ignore-dependencies
Chocolatey v0.9.9.0
Upgrading the following packages:
cutepdf
By installing you accept licenses for the packages.
cutepdf v3.0 is the latest version available based on your source(s).

Chocolatey upgraded 0/1 package(s). 0 package(s) failed.
 See the log for details.
ferventcoder commented 9 years ago

This should work now... as of rc8. This is based on this scenario - https://github.com/chocolatey/choco/blob/master/Scenarios.md#when-upgrading-a-dependency-legacy-folder-version

ferventcoder commented 9 years ago

Closing as fixed.