Search code examples
haskellghcchocolateyghcup

Replacing an old version of ghc (installed with choco) with the newest ghc (installed with ghcup)


I had ghc 8.10.1 (on Windows 10) that I installed back when choco was the recommended installation option. Now I wanted to update ghc and heard that ghcup is the new preferred way to install. I used ghcup according to the instructions and, as far as I can understand, the process concluded successfully without errors.

Here is a part of ghcup list:

X  ghc   8.10.1   base-4.14.0.0
X  ghc   8.10.2   base-4.14.1.0
X  ghc   8.10.3   base-4.14.1.0
X  ghc   8.10.4   base-4.14.1.0
X  ghc   8.10.5   base-4.14.2.0
X  ghc   8.10.6   base-4.14.3.0
IS ghc   8.10.7   recommended,base-4.14.3.0
X  ghc   9.0.1    base-4.15.0.0
X  ghc   9.0.2    base-4.15.1.0
X  ghc   9.2.1    base-4.16.0.0
X  ghc   9.2.2    base-4.16.1.0
X  ghc   9.2.3    latest,base-4.16.2.0

However, ghc --version is still 8.10.1. Where might the installation have gone wrong and what can I do to get the newest versions of everything (including cabal and stack)?


Solution

  • The issue was fixed by adding C:\ghcup\bin to Path and moving it to the top. It seems that I had everything installed - it just wasn't added to Path.

    I suppose that instead of moving the new path to the top I could have removed the old path but I wasn't sure what needed to be removed and didn't want to risk removing anything useful.