古いHaskell Platformのアンインストール方法
Haskell Platform 2014.2.0.0入れちゃってから古い2012.4.0.0が残ってるのを消すの以下の方法でできる。手元の環境はMac OSX 10.10(Yosemite)です。
まずuninstall-hsで認識されてるバージョンを確認する。
$ uninstall-hs -- Versions found on this system 7.6.3 7.8.3 -- To remove a version and all earlier: uninstall-hs thru VERSION -- To remove only a single version: uninstall-hs only VERSION
ちなみに手動で特定バージョン7.8.2とかのGHCだけ入れたりしたのも認識されてuninstall-hsで消せる。
次に削除されるファイルの事前確認する。
$ uninstall-hs only 7.6.3 -- Would remove just version 7.6.3 /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64 /Library/Haskell/ghc-7.6.3 (略) -- To actually remove these files, sudo run the command again with --remove -- To generate a script to remove these files, run the command again with --script
問題なければ削除コマンド実行して削除する。
$ sudo uninstall-hs only 7.6.3 --remove
削除後の確認
$ uninstall-hs -- Versions found on this system 7.8.3 -- To remove a version and all earlier: uninstall-hs thru VERSION -- To remove only a single version: uninstall-hs only VERSION
ちゃんと消えた。
ちなみにバージョンアップではなくHaskell環境を全消しするには全部のバージョンuninstall-hsした後に以下のディレクトリのゴミもrmしておく必要があるようです。(試してないですが参考→今のバージョンでYesodアプリを動かすまで - rfなブログ)
$ rm -rf ~/.cabal/ ~/.ghc/ ~/cabal-dev/ $ rm -rf ~/Library/Haskell/ $ sudo rm -rf /Library/Haskell/ $ sudo rm -rf /Library/Frameworks/GHC.framework