flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

install.sh suggests .bash_profile on Ubuntu

Open karlhorky opened this issue 1 year ago • 1 comments

Describe the bug

The flyctl install script at https://fly.io/install.sh is suggesting users use $HOME/.bash_profile on Ubuntu, which doesn't read this file by default

$ curl -L https://fly.io/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1735    0  1735    0     0  12811      0 --:--:-- --:--:-- --:--:-- 12851
######################################################################## 100,0%
set update channel to shell
flyctl was installed successfully to /home/corna/.fly/bin/flyctl
Manually add the directory to your $HOME/.bash_profile (or similar)
  export FLYCTL_INSTALL="/home/corna/.fly"
  export PATH="$FLYCTL_INSTALL/bin:$PATH"
Run '/home/corna/.fly/bin/flyctl --help' to get started

This led to confusing instructions for a student, where they added the export to $HOME/.bash_profile (which appeared to be correct) and then it was not being read on Ubuntu - after opening a new terminal, flyctl could not be found:

flyctl: command not found
  • Operating system: Linux Ubuntu 22.04.4 LTS
  • fly version: flyctl v0.2.71 linux/amd64 Commit: e1491edef1d9b04d94d54bfc893fef59c4d5bed5 BuildDate: 2024-06-15T22:28:28Z

Maybe it would be good to suggest .bashrc on Ubuntu? (or just always .bash_profile and .bashrc?)

fly.toml

Not relevant

Command output:

See above

karlhorky avatar Jun 18 '24 10:06 karlhorky

Also, I'm not sure where to report this feature suggestion for the installer, because there is only a "bug" issue type here, but I have another suggestion:

Automatically modify PATH in installer

It would be helpful if the installer at https://fly.io/install.sh would modify the PATH in correct files on all platforms

This would require reconsidering the Fly.io team position mentioned in the comment by @jsierles:

the install script will not modify your PATH

Currently, the installer script at https://fly.io/install.sh is the worst of all install options, since it requires manually editing .bash_profile, .bashrc, .zshrc, etc.

On other platforms like Windows and macOS, we luckily have Chocolatey and Homebrew which can take this over for us:

  • Windows (Chocolatey): https://community.chocolatey.org/packages/flyctl
  • macOS (Homebrew): https://formulae.brew.sh/formula/flyctl

But on Linux, the Snap is the super old 0.0.7 version (2 August 2019), so we still recommend students use the install script, which has these downsides.

karlhorky avatar Jun 18 '24 10:06 karlhorky