(Imported from Trac #497, reported by Martijn on 2009-02-12)
Together with the "There is no package named .." error, a message could be provided that updating the package list might solve the problem.
(Imported comment by @byorgey on 2009-02-12)
Patch fixing #497
(Imported comment by @byorgey on 2009-06-11)
I forget the proper procedure for getting a patch reviewed. Is it enough to attach it here? Or should I just send it directly to the list?
(Imported comment by @dcoutts on 2009-06-11)
Thu Jun 11 18:12:33 BST 2009 Brent Yorgey <firstname.lastname@example.org>
$ cabal install foo-2.0
cabal: There is no available version of foo that satisfies ==2.0
cabal install foo
No packages to be installed. All the requested packages are
already installed. If you want to reinstall anyway then use
the --reinstall flag.
This is a bit harder to check up-front since it's not simply a matter of checking if the package is already installed (eg it might be registered but have broken or inconsistent deps). This error is currently reported in Distribution/Client/Install.hs once we discover that the proposed InstallPlan has no packages to be installed. This is probably the best place to report since we have access to the installed packages at that point.
(Imported comment by @kowey on 2009-06-14)
I've attached a patch which I think takes care of the "no available version" case, albeit not in a particularly principled way...
The current resolver doesn't mention cabal update specifically, but I haven't really had an issue with this since it mentions it can't find the dependency.
Anyway, since there is no activity since 2009 I propose closing. Please re-open or create a new issue if this problem still exists.