Getting flyctl: command not found error post install

Hi,

I’ve just installed FLYCTL on my linux system and when i try to sign up using flyctl auth signup, I get
lyctl: command not found.

Is there any additional step i need to follow?

Thanks in advance

Did you use the recommended install script?

Only you can take a look at the https://fly.io/install.sh that runs and can see at the bottom that should try and add it to the PATH so that you can just type flyctl (or fly) without any prefix (like /usr/bin/flyctl or /usr/local/bin/flyctl.

So … either it has not been installed or it has been installed, but it has not been added to the PATH and so can’t be run with just flyctl. Maybe take a look at the /bin folders and see if it’s there?

Hi @greg I have the same problem. I’ve tried all way to fix that but i couldn’t succeed. can you please help me !

hi! If you’re getting a “flyctl: command not found error”, then you probably just need to configure your shell to add your fly install to your $PATH for all new shells you start with whichever terminal app you’re using.

How to do this will depend on what shell you’re using, since you’d use a different config file with each one.

What happens when you run the following?

cd ~ ; pwd
.fly/bin/flyctl version
1 Like

Hi @victor-barh : no need for me, @eli is on the case :slight_smile: Check :arrow_up:

1 Like

I’m getting thisflyctl v0.0.381 linux/amd64 Commit: ed6bc2a6 BuildDate: 2022-08-23T14:17:58Z. so how can i add it to my PATH

You’ll need to figure out what shell you’re using on your local machine. For most desktop Linux users, this will be bash by default:

That said, it may vary depending on your distro or setup. Running echo $SHELL will let you know what shell you’re running. If it’s not bash, check that project’s documentation website for specific instructions.

If you are running bash, then you can add flyctl to your path by running the following:

NOTE 1: make sure you replace "<your-user>" with the name of your actual user (to double-check this, make sure it matches the output of whoami )

export FLYCTL_INSTALL="/<your-username>/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"

Then you’ll want to open your ~/.bashrc file [see note 2] file your favorite text editor, append the above two lines to it and save. Finally, it’s convenient to tell your enviroment you want to make this the default for new shells:

source ~/.bashrc 

NOTE 2: there are other places where you can configure bash behavior. In this case we configured the current user’s bash to know where to find flyctl.

It’s not necessary knowledge to use fly, but knowing all the configuration options for your shell is worthwhile if you’re planning on spending much time there. Here’s a good overview of all the different ways bash can be configured

If you prefer more of a zine/blog-style resource, and want to learn bash specifically as a newer Linux user, I’ve yet to see a better resource than Bite Size Bash :smile:

2 Likes

Hi, I’m receiving the same error and I ran that command gives me this:

.fly/bin/flyctl version
/home/tongs
flyctl v0.0.383 linux/amd64 Commit: 16a17b20 BuildDate: 2022-08-25T22:18:50Z

In that case, you’ll probably want to go through the above listed steps-- adding flyctl to your $PATH will let you use the flyctl command without having to specify where it is every time. Have you tried the steps outlined above yet? If so, what what the result?

Hi there, jumping in as I had the same error. In fact when I ran the install.sh script it actually gave me the following output which supports what you’ve been advising:

flyctl was installed successfully to /var/services/homes/[USERNAME]/.fly/bin/flyctl
Manually add the directory to your $HOME/.bash_profile (or similar)
  export FLYCTL_INSTALL="/var/services/homes/[USERNAME]/.fly"
  export PATH="$FLYCTL_INSTALL/bin:$PATH"
Run '/var/services/homes/[USERNAME]/.fly/bin/flyctl --help' to get started

I ran both export lines and added both to my .bashrc file, can confirm this works, thanks for the advice.

3 Likes