Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basics ./prereqs.sh Error ./prereqs.sh: line 250: ghcup: command not found #1028

Closed
Bossman42 opened this issue Aug 20, 2021 · 7 comments
Closed

Comments

@Bossman42
Copy link

Trying to setup cardano node and following the guild guide on the basics page the following happened.

Using Ubuntu on windows 10

After attempting the line in basics

./prereqs.sh

to setup the prereqs.sh I got this error.

Installing GHC v8.10.4 ..
./prereqs.sh: line 250: ghcup: command not found
./prereqs.sh: line 251: ghcup: command not found
./prereqs.sh: line 252: ghc: command not found
Installing Cabal v3.4.0.0..
./prereqs.sh: line 261: ghcup: command not found

Am I missing something? or is this normal?

Command Not Found

@rdlrt
Copy link
Contributor

rdlrt commented Aug 20, 2021

Using Ubuntu on windows 10

I think this is the issue 🙂 Most of the scripts are created purely for Linux environments. In this case, after installing ghcup, it seems that the profile / session has not been retained - requiring you to run source ~/ada/.ghcup/env manually and then potentially re-running the script.

@kivanio
Copy link

kivanio commented Aug 22, 2021

I got same on Ubuntu 20.04 (LTS) x64 VM machine at Digital Ocean
5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

@rdlrt
Copy link
Contributor

rdlrt commented Aug 24, 2021

@kivanio

  1. Could you confirm if bashrc file under your profile contains the ghcup additions?
  2. Could you also try using prereqs.sh -b alpha and then rerun prereqs script (specifically for this commit additions)

@kivanio
Copy link

kivanio commented Aug 25, 2021

@rdlrt
1 - This is what .bashrc has:

export CNODE_HOME=/opt/cardano/cnode

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

. "$HOME/.cargo/env"

[ -f "/home/user/.ghcup/env" ] && source "/home/user/.ghcup/env" # ghcup-env

2 -

:~/tmp$ ./prereqs.sh -b alpha
Using apt to prepare packages for "Ubuntu" system
  Updating system packages...
[sudo] password for kadarelay: 
  Installing missing prerequisite packages, if any..
Creating Folder Structure ..
Environment Variable already set up!
IOG fork of libsodium installed to /usr/local/lib/
Downloading files...

Are supposed to destroy everything and start again with /prereqs.sh -b alpha?

@rdlrt
Copy link
Contributor

rdlrt commented Aug 25, 2021

Looks like it went fine (even from master), as ghcup was already available in your $PATH. Are you sure you received the exactly same message as OP (incl. the line numbers)?

@dehy
Copy link
Contributor

dehy commented Aug 31, 2021

Had this problem today on ubuntu 20.04. In .bashrc file, there is these lines:

/root/.bashrc

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

For non-root users, in /home/<user>/.bashrc:

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

So environment is not reloaded after it got updated because the script is not executed interactively

Edit: here is some more information https://askubuntu.com/a/1041348

rdlrt added a commit that referenced this issue Sep 3, 2021
@rdlrt
Copy link
Contributor

rdlrt commented Sep 3, 2021

Linked PR should fix it, as it will directly source the env file instead of bashrc

@rdlrt rdlrt closed this as completed Sep 3, 2021
rdlrt added a commit that referenced this issue Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants