LoginSignup
7
2

More than 5 years have passed since last update.

EC2 へ fish-shell インストール

Last updated at Posted at 2017-09-25

» 良くわからないけどできた感じなので、他にもっといい方法有ると思う。

LinuxBrew インストール

homebrewのlinux版みたいなものらしい。これを叩く。

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
ログ
==> Installation successful!
# ...
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.

(パス通すか)これでコマンドが使えます。

/home/linuxbrew/.linuxbrew/bin/brew 

Fish インストール

homebrewと一緒ですね。

/home/linuxbrew/.linuxbrew/bin/brew install fish
ログ
==> Caveats
You will need to add:
  /home/linuxbrew/.linuxbrew/bin/fish
to /etc/shells.

Then run:
  chsh -s /home/linuxbrew/.linuxbrew/bin/fish
to make fish your default shell.

==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/fish/2.6.0: 896 files, 48.3MB

/etc/shells へ追記

sudo vim /etc/shells

で、/home/linuxbrew/.linuxbrew/bin/fishを一番最後の行に追加します。

こんな感じになる

/etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/home/linuxbrew/.linuxbrew/bin/fish

デフォルトシェル変更

ユーザー名は好きな名前で、chshします。

sudo chsh -s /home/linuxbrew/.linuxbrew/bin/fish ec2-user

確認

一旦sshを入り直して、$SHELLがちゃんと変ったらOK。

ec2-user@ip-x-x-x-x ~> echo $SHELL
/home/linuxbrew/.linuxbrew/bin/fish

ただやっぱり、linuxbrewでインストールしたコマンドを使いやすくするためにconfig.fishではパスを追加した方がいいかも。

vim ~/.config/fish/config.fish
~/.config/fish/config.fish
set -gx PATH /home/linuxbrew/.linuxbrew/bin $PATH
7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2