Locomotive 在 debian 系统上不起作用:sl ls

som*_*ing 3 command-line ls debian package-management

问题:

我安装了,sl但是当我sl在命令行上输入时,我得到了这个:

bash: sl: command not found
Run Code Online (Sandbox Code Playgroud)
(root@host)-(03:55:38)-(/home/user)
$apt install sl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
sl is already the newest version (3.03-17+b2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

Sl 是一个可以显示动画的程序,如果您错误地输入了 'sl',它可以纠正您。SL代表蒸汽机车。 Debian 软件包上的软件包


Cyber​​citi.biz 上的安装说明/

摘抄:

安装sl软件获取蒸汽机车(shell中的火车)

Debian/ Ubuntu Linux上键入以下 apt-get 命令/apt 命令:

$ sudo apt-get install sl
Run Code Online (Sandbox Code Playgroud)

用法

好的,只是将 ls 命令错误输入为 sl:

$ sl
Run Code Online (Sandbox Code Playgroud)
(root@host)-(03:57:47)-(/home/user)
$cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Run Code Online (Sandbox Code Playgroud)
(root@host)-(04:04:01)-(/home/user)
$bash -version
GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Run Code Online (Sandbox Code Playgroud)

题:

这里发生了什么,机车在哪,有什么需要我配置的......?

小智 8

如果你运行root(我猜你可能是因为你apt直接运行),PATH默认情况下将排除/usr/local/games并且/usr/games由于条件 in /etc/profile

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
Run Code Online (Sandbox Code Playgroud)

sl恰好在/usr/games.