GHC/Haskell 平台安装的任何地方
假设我想完全重新安装 GHC/HP。我想(就像迷信一样)删除以前安装的所有内容。我实际上需要删除什么(以及在哪里)?
编辑:我使用的是 OSX,但我更好奇这些信息是否适用于所有系统。
Edit2:到目前为止我们有:
OSX:
/Library/Frameworks/GHC.framework/
〜/.cabal/
/usr/bin/ --
我将添加符号链接(基于此处定义的“前缀”: http://www.vex.net/~trebla/haskell/sicp.xhtml#storage):
前缀/lib/
前缀/共享/
前缀/bin/
前缀/共享/doc/
/usr (/local) /lib/[ghc-版本]
/usr (/local) /share/doc/ghc/html/libraries/ -- 文档
/usr (/local) /share/doc/ghc/
/usr (/local) /bin
/var/lib/[ghc-版本]
/etc/[ghc-版本]
~/.ghc/
编辑 3:
操作系统:
〜/库/Haskell
Linux:
??
窗口:
??
Assume I want to completely reinstall GHC/HP. I want to (as much for superstition as anything) delete anything and everything from previous installs. What do I actually need to delete (and where)?
Edit: I'm on OSX, but I'm more curious if this information is available in general, for all systems.
Edit2: So far we have:
OSX:
/Library/Frameworks/GHC.framework/
~/.cabal/
/usr/bin/ -- symlinks
I'll add to that (based on "prefix" defined here: http://www.vex.net/~trebla/haskell/sicp.xhtml#storage):
prefix/lib/
prefix/share/
prefix/bin/
prefix/share/doc/
/usr (/local) /lib/[ghc-version]
/usr (/local) /share/doc/ghc/html/libraries/ -- documentation
/usr (/local) /share/doc/ghc/
/usr (/local) /bin
/var/lib/[ghc-version]
/etc/[ghc-version]
~/.ghc/
Edit 3:
OS X:
~/Library/Haskell
Linux:
??
Windows:
??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最近不得不删除 OS X 上的 Haskell Platform。大多数都是通过卸载程序清理的:
这些必须手动清理:
或者,如文档中所述,
现在有一个带有选项的自定义卸载命令,
一般来说,可以通过以下方式记录由任何活动(安装程序,...)创建的文件:将工作目录中的活动括起来
Had to remove Haskell Platform on OS X recently. Most are cleaned up via Uninstaller:
These have to be cleaned up manually:
Alternatively, as documented in
there is now a custom uninstall command with options,
In general, one can document the files created by any activity (installer, ...) by bracketing the activity in a work directory with
如果您从 2012 年左右就在 OS X 上安装了 Haskell Platform,只需运行
并仔细阅读它的输出即可。您需要使用它提供的选项再次运行它。运行
以获得更多选择。
下面是我原来的答案,它仍然有效,但没有提供那么多选项,而且有点“火腿拳头”:
警告: 这个脚本是极端的。它甚至会删除甚至是 GHC 和 Cabal 的自定义配置文件,以及您构建的仍位于
~/Library/Haskell
中的可执行文件或~/.cabal
。谨慎使用;回顾它将要做什么;有备份;警告编剧!您可能需要添加行来保存和恢复您的配置文件,例如:
并将
这些行放在
rm
行中。不过,如果您要升级到较新的内容,您可能需要也可能不需要旧的~/.cabal/config
。请注意,这仅处理当前用户的主目录。如果您有多个用户帐户都使用 Haskell,那么其他帐户也需要清理。 (重复涉及
~
的行。)If you've installed a Haskell Platform since about 2012 on OS X, just run
and carefully read what it outputs. You'll need to run it again with the options it offers you. Run
for more options.
Below is my original answer, which will still work, but doesn't offer as many options and is a bit "ham fisted":
Warning: This script is extreme. It will remove even your custom config files for GHC and Cabal, and executables you've built that are still in
~/Library/Haskell
or~/.cabal
. Use caution; review what it is about to do; have backups; caveat scriptor!You may want to add lines to save off and restore your config files like:
and
Bracket the
rm
lines with these. Though you may or may not want your old~/.cabal/config
if you are upgrading to newer stuff.Note that this only deals with the current user's home directory. If you have multiple user accounts that all use Haskell, then the other accounts will need cleaning as well. (Repeat the lines involving
~
.)我使用的是 OSX (Lion atm)。我在 /Library/Frameworks/GHC.framework/ (当前和以前的版本)中有 GHC。 /usr/bin 中还有一些符号链接,但这些符号链接将被新安装替换。
如果您使用 cabal (本地)安装软件包,您可能还需要清理 ~/.cabal。如果您有最新的 cabal,您可以使用 cabal install world 轻松地重新安装“新”GHC 版本的所有软件包,然后查找与您之前的 GHC 版本相匹配的目录,如下所示:
这些应该可以安全删除。
希望这对您有所帮助。
I am on OSX (Lion atm). I've got GHC in /Library/Frameworks/GHC.framework/ (current and previous versions). There are also some symlinks in /usr/bin, but these will be replaced by a new install.
If you have used cabal to (locally) install packages, you also may want to clean out ~/.cabal. If you have a recent cabal, you can easily reinstall all packages for the 'new' GHC version by using cabal install world and then look for directories matching previous version of GHC you had like so:
These should be safe to delete.
Hope this helps you somewhat.
uninstall-hs
为您完成一些工作;我不确定是多少。uninstall-hs
does some of the work for you; I'm not sure how much.