如何在 AWS Linux 上安装 Fish Shell

How do I install Fish Shell on AWS Linux

我似乎无法在 AWS Linux 实例上安装 Fish shell。我不断收到以下错误,似乎找不到解决方法。

[root@ip-172-31-20-125 ec2-user]# yum -y install fish
Loaded plugins: priorities, update-motd, upgrade-helper
Repository shells_fish_release_2 is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
---> Package fish.x86_64 0:2.5.0-1.2 will be installed
--> Processing Dependency: hostname for package: fish-2.5.0-1.2.x86_64
--> Finished Dependency Resolution
Error: Package: fish-2.5.0-1.2.x86_64 (shells_fish_release_2)
           Requires: hostname
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

与 Centos 6 相同。

from:

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/shells:fish:release:2/CentOS_6/shells:fish:release:2.repo
yum install fish

2021 年更新:

如果您运行正在使用较新版本的 AWS Linux - 运行 rpm -E %{rhel} 查看 RHEL 版本,然后使用 one of the links here对于 wget 命令。例如,如果 RHEL 版本是 7,运行 as root:

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 的 Red Hat 6 软件包存储库,这对 Amazon 来说效果很好Linux2:

sudo yum-config-manager --add-repo http://fishshell.com/files/linux/RedHat_RHEL-6/fish.release:2.repo

之后就可以正常安装了

sudo yum -y install fish

这在发布时对我有用:

cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

添加回购

sudo yum-config-manager --add-repo http://fishshell.com/files/linux/RedHat_RHEL-6/fish.release:2.repo

清洁

sudo yum clean all

安装

sudo yum -y install fish

测试

    [ec2-user@ip-xxx-xx-x-xx] yum.repos.d]$ fish
Welcome to fish, the friendly interactive shell