Cabal fails when building Cardano Node

Hi there,

I’m having the following problem after executing the command cabal build all:

cabal: Failed to build aeson- (which is required by test:cardano-node-test from cardano-node-1.19.0, exe:cardano-node from cardano-node-1.19.0 and others). The build process terminated with exit code -6

I’m following Cardano’s Stake Pool Course on setting up a Cardano Node.

Thank you very much,


hi Matias!

quick questions:
which OS you are using?
Did you update cabal?

cabal update
cabal --version

Hey. Sometimes ghc throws errors when resources are busy. Check your output if there are errors pre-dating the one mentioned above.

Sometimes it’s even non-deterministic - so try building again and watch if the error repeats.

You could also try a cabal clean before you do cabal build all

Hi Lauris and Stablepool!

I’m running on an AWS Instance, with Linux.

I have followed exactly Cardano’s Stake Pool Guide. That means I’ve already run cabal update and after that cabal --version. Anyway, I have run them again. This is what I get:

[ec2-user@ip-172-31-37-144 ~]$ cabal update Downloading the latest package list from To revert to previous state run: cabal v2-update ',2020-09-21T21:43:55Z' [ec2-user@ip-172-31-37-144 ~]$ cabal --version cabal-install version compiled using version of the Cabal library

And after that I’ve done cabal clean and cabal build all as you guys suggested. Now this is what I’m getting:

Cloning into '/home/ec2-user/cardano-node/dist-newstyle/src/ouroboros_-e7dffa0d85e2839'... remote: Enumerating objects: 1249, done. remote: Counting objects: 100% (1249/1249), done. remote: Compressing objects: 100% (749/749), done. remote: Total 104885 (delta 914), reused 613 (delta 422), pack-reused 103636 Receiving objects: 100% (104885/104885), 110.35 MiB | 14.03 MiB/s, done. Resolving deltas: 100% (73114/73114), done. HEAD is now at f0eb6e439 Merge #2546 Warning: Requested index-state2020-07-15T00:00:00Z is newer than ''! Falling back to older state (2020-07-14T22:50:55Z). Resolving dependencies... cabal: Could not resolve dependencies: [__0] next goal: cardano-crypto-class (user goal) [__0] rejecting: cardano-crypto-class-2.0.0 (conflict: pkg-config package libsodium-any, not found in the pkg-config database) [__0] fail (backjumping, conflict set: cardano-crypto-class) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: cardano-crypto-class

I’ve tried like 5 times already. I don’t think that’s the problem in this case…

Maybe this is the problem. Did you install libsodium prior to building?

Download and install GHC:

tar -xf ghc-8.6.5-x86_64-deb9-linux.tar.xz
rm ghc-8.6.5-x86_64-deb9-linux.tar.xz
cd ghc-8.6.5
./configure sudo make install

Back in your home directory:

Install Libsodium

git clone
cd libsodium
git checkout 66f017f1
sudo make install

Add the following to your .bashrc file and source it.

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"


sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get -y install python3 build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev systemd libsystemd-dev libsodium-dev zlib1g-dev yarn make g++ jq libncursesw5 libtool autoconf
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

git clone
cd cardano-node
git fetch --all --tags && git tag
git checkout tags/1.19.1
echo -e “package cardano-crypto-praos\n flags: -external-libsodium-vrf” > cabal.project.local
cabal update
cabal build all

Sorry guys but I’m getting the same. I don’t know what I’m doing wrong, but I’m back at the beginning. I also have both GHC and Libsodium correctly installed.

cabal: Failed to build aeson- (which is required by test:cardano-node-test from cardano-node-1.19.0, exe:cardano-node from cardano-node-1.19.0 and others). The build process terminated with exit code -6

I have tried all the commands you told me and set the environment variables you mentioned.

Any other thoughts?

Thank you!


I tried everything again and now I’m getting this error on a previous step, which was working before (installation of GHC). It’s after I run sudo make install:

/usr/local/lib/ghc-8.6.5/bin/ghc-pkg: error while loading shared libraries: cannot open shared object file: No such file or directory make[1]: *** [install_packages] Error 127 make: *** [install] Error 2

I’m now following this guide:

Thank you!


are you running installation as root or non-root (regular user with sudo rights)?
looks like something is messed up there… i would start from scratch

as there is a new version out… i would suggest to remove everything and start fresh
you can this updated guide:

let me know if it helps

Maybe you can check your LD_LIBRARY_PATH and PATH if anything was overwritten? Usually the libraries and binaries are referenced relative to these path’s.

Also I have better experience defining export NCPUS=1 before “cabal build all” as ghc might throw errors else.
But the problem you are describing is definetly linked to the libraries, so check your paths. Also try a


and see if the library can be found.

If locate doesnt work try:
find /lib/ -name

On my server its located in: /lib/x86_64-linux-gnu/


Yes, I’m running as “ec2” user in AWS. Thanks for the guide, I’m gonna try that one today. Is it really necessary to create a new user for the node? If yes, do you know how to do it in the AWS console? Because these commands are not working as expected in the guide:

sudo adduser cardano (this one doesn’t provide the ability to set a password for the account"

sudo usermod -aG sudo cardano (this one directly doesn’t work)

Thank you!


The values of LD_LIBRARY_PATH and PATH before trying to install GHC are:

[ec2-user@ip-172-31-32-198 ~]$ echo $LD_LIBRARY_PATH /usr/local/lib:

[ec2-user@ip-172-31-32-198 ~]$ echo $PATH /home/ec2-user/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user /bin

Is it OK?



None of those commands are working on my instance…

The first one gives this error:

[ec2-user@ip-172-31-32-198 ghc-8.6.5]$ locate locate: can not stat () /var/lib/mlocate/mlocate.db: No such file or directory

And the second one doesn’t give any information:

[ec2-user@ip-172-31-32-198 ~]$ find /lib/ -name [ec2-user@ip-172-31-32-198 ~]$

I have manually located in usr/lib64/

I’m not finding number 5 anywhere.

At the moment, I could fix the installation of GHC by following this link:

I’m gonna continue now with the rest. I’ll let you know, guys.