AmazonLinux2にfishを入れるとエラーが出る

私はfishシェルがとても使いやすくて気に入っているのですが、epelリポジトリからインストールする方法でAmazonLinux2にfishシェルをインストールすると下記のようなエラーが出てしまいました。

Failed to execute process '/usr/share/fish/tools/create_manpage_completions.py'. Reason: The file '/usr/share/fish/tools/create_manpage_completions.py' does not exist or could not be executed.

このままでも使えないこともないのですが、fishシェルの起動のたびに表示されるのが煩わしいので、対処します。

エラー内容でググったら下記のissueに回答がありました。
Failed to execute process ‘/usr/share/fish/tools/create_manpage_completions.py’

So, this is most certainly caused by EPEL/Fedora’s packaging, since our scripts just all use #!/usr/bin/env python (and in fish 2.6.0 we changed it so our wrapper functions try python3, python2 and python).

In fact, I’m quite sure that it is caused by http://pkgs.fedoraproject.org/cgit/rpms/fish.git/commit/fish.spec?h=epel7&id=178a776c867c4c4839641e816bba07b6ff53bb2b.

@amluto: Mind taking a look? Also, I know that you were a bit bothered by us calling python, so you might want to either upgrade fish to 2.6.0 or cherry-pick 7ef2d5e, e410d47 and 805a177.

「eqelリポジトリの影響だ!fishの2.6.0をインストールしてくれよな!」みたいなことが書いてあります。
バージョンを確認したところ2.3.1が入っていました

fish --version
fish, version 2.3.1

2017年には2.6.0とのことなので今回は3系をインストールしていきたいと思います。

fish3系のインストール

公式サイトを参考にコマンドを確認していきます。
fish shell

LinuxのカテゴリにAmazonLinux2の記述がないので、Centos7を実行していきます。

下記のコマンドをsudo権限で行います。

cd /etc/yum.repos.d/
wget https://download.opensuse.org/repositories/shells:fish:release:3/CentOS_7/shells:fish:release:3.repo
yum install fish

インストールできたらfishシェルを起動してみます。

$ fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

ここではデフォルトシェルの変更は行いません。
fishのバージョンを確認します。

fish --version
fish, version 3.2.1

エラーも解消できて、最新版のfishを入れることができました!