Cabal not changing from (solved)

Using these commands:

ghcup upgrade (just to make sure ghcup is on the latest version)
ghcup install ghc 8.10.4
ghcup set ghc 8.10.4
ghc --version (just to check the correct version)
ghcup install cabal
ghcup set cabal
cabal --version (just to check the correct version)
cabal update (just to make sure all dependencies are in the info)

Some reason its showing this after setting cabal:

$ ghcup set cabal
[ Warn ] New GHC version available: 9.0.1. To upgrade, run ‘ghcup install ghc 9.0.1’
[ Info ] Cabal successfully set as default version

$ cabal --version
cabal-install version
compiled using version of the Cabal library

Solved the problem here is what I did:
search “cabal”

Changed the paths after using “ghcup” to install ghc & cabal

echo PATH="$HOME/.local/bin:$PATH" >> $HOME/.bashrc
echo export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" >> $HOME/.bashrc
echo export NODE_HOME=$HOME/cardano-my-node >> $HOME/.bashrc
echo export NODE_CONFIG=mainnet>> HOME/.bashrc echo export NODE_BUILD_NUM=(curl | grep -e “build” | sed ‘s/.build/([0-9])/download.*/\1/g’) >> $HOME/.bashrc
source $HOME/.bashrc

I had the same problem and it was driving me crazy. It was only happening on my BP machine. I had found a copy of the cabal executable in another bin folder. I’m not completely sure how it got there but I think your solution explains it a bit.

Yes I found a copy of cabal inside of .local/bin

I deleted that, reinstalled Cabal and copied the new path inside of .bashrc and it fixed the problem.

the GHCUP method puts it in .ghcup

Thanks and jeremyisme…but I’m still confused as to what to do. I am having the exact same problem. Namely, that my cabal --version is showing 3.2 even though I am following steps here:

Can you please explain step by step what to do to resolve this. Like Jeremy, it is also driving me bonkers. :slight_smile:

I am not following here either. What should the paths be changed to?

cntools or coincashew?
also can u share the last lines (export lines) from bashrc file?

nano ${HOME}/.bashrc


Okay was able to fix it myself by clearing out the old ghc and cabal versions then updating PATH. Instructions below :slight_smile:

STEPS --------------------
sudo rm -rf /home/cardano/.local/bin/cabal
Update Path in .bashrc → ADD /home/cardano/.ghcup/bin/cabal

GHC FIX ****
sudo rm -rf /usr/local/bin/ghc
Update Path in .bashrc → ADD /home/cardano/.ghcup/bin/ghc

curl --proto ‘=https’ --tlsv1.2 -sSf | sh
source /home/cardano/.ghcup/env OR restart terminal session

source .bashrc
ghc --version
cabal --version

1 Like