flyctl through Ubuntu in WSL2, installed via
curl -L https://fly.io/install.sh | sh. After successful installation, I follow the instructions to add the directory to
Everything works as normal until I close the WSL2 window. When I open a new WSL2 window, I receive
flyctl: command not found and have to reinstall
What can I do to make the installation persistent?
Hmmm…looks like your .bash_profile is probably not being read when your terminal is being started. I believe a login shell with “bash -l” or moving the installation command in .bashrc may work.
I thought the
export lines were being added to my profile, but they weren’t. In my WSL2 instance, the file is
~/.bash_profile. I manually added:
~/.profile and that fixed the problem. I realize this isn’t a fly.io issue but it’s a simple gotcha that might help someone else.
I am running Ubuntu 20.04.4 LTS and was facing this issue. By adding the below commands at the end of the
.bashrc file by opening it in the nano editor I was able to fix it