Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Don't recommend --force-reinstalls #1201

wants to merge 2 commits into from

4 participants


In case 'cabal install' selects destructive reinstalls it suggests '--force-reinstalls'. In my experience this is seldom what one wants since it is likely to destroy other installed libraries. It should additionally suggest '--avoid-reinstalls' and/or manually unregistering conflicting packages.

Feel free to rephrase the warning message.

@soenkehahn soenkehahn better warning message: suggest '--avoid-reinstalls' or
'ghc-pkg unregister' in case 'cabal install' selects destructive

I don't think you can assume that the underlying compiler is GHC here.


@23Skidoo: Of course, you're right. Thanks.


@kosmikus Do you agree with this change?


I'm not convinced. It's often the case that --force-reinstalls is exactly what is needed. For example when hacking on a collection of related packages, making a change in a dependent package and then rebuilding. Of course it's going to break the others, but I'm rebuilding them so that's fine.

I'm happy with making the warning clearer and/or more fierce. I'm not sure that recommending --avoid-reinstalls is a good idea, I don't think the --avoid-reinstalls behaviour is often what you want (it means it'll select non-ideal versions, e.g. older ones, to avoid breaking existing ones).


I am not at all insisting on my specific wording. And I see your usecase where --force-reinstalls is what one wants. I still think it would be good to tell users that there are alternatives to --force-reinstalls.

Would you be happier with the warning if it mentioned the disadvantages of --avoid-reinstalls?


I'm not convinced either. I completely agree that the suggestion to use --force-reinstalls leads to people typing --force-reinstalls and subsequently complaining that everything is broken. However, --avoid-reinstalls in my experience is even less often what you want. It looks good in theory. But most of the time there are some old versions with missing upper bounds around, so you'll just turn a solver error into a build phase error.


Closing as rejected.

@23Skidoo 23Skidoo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2013
  1. @soenkehahn

    better warning message: suggest '--avoid-reinstalls' or

    soenkehahn committed
    'ghc-pkg unregister' in case 'cabal install' selects destructive
Commits on Feb 17, 2013
  1. @soenkehahn
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 cabal-install/Distribution/Client/Install.hs
4 cabal-install/Distribution/Client/Install.hs
@@ -431,7 +431,9 @@ checkPrintPlan verbosity installed installPlan sourcePkgDb
then if dryRun then [] else
["Continuing even though the plan contains dangerous reinstalls."]
- ["Use --force-reinstalls if you want to install anyway."]
+ ["Try --avoid-reinstalls to avoid selecting destructive reinstalls or " ++
+ "manually uninstall conflicting packages.",
+ "Use --force-reinstalls if you want to install anyway (including destructive reinstalls)."]
else unless dryRun $ warn verbosity
"Note that reinstalls are always dangerous. Continuing anyway..."
Something went wrong with that request. Please try again.