我通过apt在Ubuntu Server 18.04上安装了软件包fortunes-de
。此后,似乎没有fortune
命令,只有运气文件。
如果我另外安装软件包fortunes
,则仍然没有二进制文件。
问题:要在Ubuntu Server 18.04上运行fortune
命令,我需要做什么?
它曾经在Ubuntu Server 16.04和更早的版本上工作。
fortune
二进制文件通过程序包fortune-mod
提供,位于/usr/games
中。
user@server:~$ dpkg -L fortune-mod | grep /fortune\$
/usr/games/fortune
默认情况下,ubuntu服务器在/usr/games
中没有PATH
:
user@server:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
因此命令fortune
将无法像在命令行上那样工作。但是桌面上确实包含PATH
中的游戏:
user@desktop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
因此,在桌面上,命令fortune
应该像这样运行。但是在服务器上,您需要调用的是完整路径,例如:
user@server:~$ /usr/games/fortune
Every program has at least one bug and can be shortened by at least one
instruction -- from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.