So, I have installed fortune on my Rackspace server but if I run it without any arguments it says

No fortunes found

I installed the package as root so there shouldn't be a permissions issue. The directory /usr/share/games/fortunes doesn't even exist which is where it's supposed to store the fortunes. I thought it might be a Rackspace package issue so I install the latest stable deb package with dpkg from https://launchpad.net/ubuntu/+archive/primary/+files/fortune-mod_1.99.1-7_amd64.deb. I've tried uninstalling fortune and fortune-mod and re-installing them with aptitude to no avail. What could the issue be?


Solution 1:

The package fortune (or fortune-mod) only contain the program to display the fortune cookies, not the cookies (texts) themselves.

You need to additionally install a fortunes* package. Which ones are available for your system can be easily checked with the command apt-cache search "^fortunes". On my system, the output is:

fortunes - Data files containing fortune cookies
fortunes-bg - Bulgarian data files for fortune
fortunes-bofh-excuses - BOFH excuses for fortune
fortunes-br - Data files with fortune cookies in Portuguese
fortunes-cs - Czech and Slovak data files for fortune
fortunes-de - German data files for fortune
fortunes-debian-hints - Debian Hints for fortune
fortunes-eo - Collection of esperanto fortunes.
fortunes-eo-ascii - Collection of esperanto fortunes (ascii encoding).
fortunes-eo-iso3 - Collection of esperanto fortunes (ISO3 encoding).
fortunes-es - Spanish fortune database
fortunes-es-off - Spanish fortune cookies (Offensive section)
fortunes-fr - French fortunes cookies
fortunes-ga - Irish (Gaelige) data files for fortune
fortunes-it - Data files containing Italian fortune cookies
fortunes-it-off - Data files containing Italian fortune cookies, offensive section
fortunes-mario - Fortunes files from Mario
fortunes-min - Data files containing selected fortune cookies
fortunes-off - Data files containing offensive fortune cookies
fortunes-pl - Polish data files for fortune
fortunes-ru - Russian data files for fortune
fortunes-spam - fortunes taken from SPAM messages
fortunes-ubuntu-server - Ubuntu server tips for fortune

Install those packages that interest you, usually you want fortunes-min (small package of about 60 kB with few fortune cookies) or fortunes (larger package of about 1 MB with over 15,000 cookies).

The others are either localized (German or Spanish cookies for example) or cover a specific topic only (e.g. spam or offensive). You may of course install multiple fortunes packages.

If you install a language package, these are installed on a subfolder of /usr/share/games/fortunes/ so you may need to prefix it to the database name:

fortune -e -s es/asimov.fortunes ubuntu-server-tips

Oh, and don't forget: fortune works best in combination with cowsay! :D

$ fortune | cowsay
 _____________________________________
/ A handful of patience is worth more \
\ than a bushel of brains.            /
 -------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Solution 2:

As far as I know, the fortune-mod package only contains the server/engine, not the fortunes to serve. You need to install a package containing actual fortunes as well (try fortunes-min)