Debian

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

  • September 2, 2018

問題:

我安裝了sl,但是當我sl在命令行上鍵入時,我得到了這個:

bash: sl: command not found

(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.

Sl 是一個可以顯示動畫的程序,旨在糾正您錯誤輸入“sl”的情況。SL 代表蒸汽機車。 Debian 軟體包上的軟體包


cyberciti.biz/ 上的安裝說明

摘抄:

安裝sl軟體獲取蒸汽機車(train in shell)

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

$ sudo apt-get install sl

用法

好的,只是將 ls 命令誤輸入為 sl:

$ sl

(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/"

(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.

問題:

這裡發生了什麼事,機車在哪裡,有什麼我需要配置的……?

如果您正在執行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

sl恰好在/usr/games

引用自:https://unix.stackexchange.com/questions/465222