2

Every time I download a game from the terminal I can't open it.

Example 1:

$ sudo apt-get install 0ad
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0ad is already the newest version (0.0.22-3.1).
The following packages were automatically installed and are no longer required:
  libboost-atomic1.62.0 libboost-chrono1.62.0 libboost-program-options1.62.0
  libboost-serialization1.62.0 libboost-test1.62.0 libboost-timer1.62.0
  libcaribou-gtk-module libcaribou-gtk3-module libcgal12 libevent-2.0-5
  libgom-1.0-common libqcustomplot1.3 libqt5sql5 libqt5sql5-sqlite libsfcgal1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.

Now when I try to launch O A.D.:

0ad
bash: 0ad: command not found

Example 2:

sudo apt-get install nsnake

same thing...

Now time to run it.

nsnake  
bash: nsnake: command not found.  
3
$/usr/games/nsnake and /usr/local/games/nsnake

Check your PATH variable. Does it include /usr/games and /usr/local/games?

echo $PATH

If not, edit .profile to include

PATH=$PATH:/usr/games:/usr/local/games
  • 1
    i get this: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin – Iron Moods Jan 14 '18 at 20:36
  • @Iron Moods, On which command? the "/usr/games/nsnake"? or the "echo $PATH"? – jpezz Jan 14 '18 at 20:38
  • nevermind i got it working when i type /usr/games/(gamename) Thanks! – Iron Moods Jan 14 '18 at 20:39
  • @Iron Moods, . the games directory is not in your path. Neither is "/usr/local/games". Try "/usr/local/games/nsnake" but in any case to add these to your .profile file as in "PATH=$PATH:/usr/games:/usr/local/games" – jpezz Jan 14 '18 at 20:50
0

Normally $PATH variable contains two games folders - /usr/games and /usr/local/games:

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

On old-style desktops such as GNOME FlashBack or MATE DE exists Applications menu with Games category. Game with GUI may be launched from it.

If you need to know from which executable GUI game is started, you can view its .desktop file (like .lnk in MS Windows) and find its executable here.

I present example here for aisleriot package with GNOME card games:

grep -r Exec $(dpkg -L aisleriot | grep .desktop)

here:

  • dpkg -L aisleriot - lists files from aisleriot package
  • | - pipes output from left command to right command
  • grep .desktop - finds all *.desktop files in the output of dpkg command
  • grep -r Exec - finds and prints Exec lines from all found *.desktop files

On my system this command outputs the following:

Exec=/usr/games/sol

so aisleriot package has only one *.desktop file, which contains Exec=/usr/games/sol line. If one want to launch aisleriot game from terminal he should launch it with sol command (locate in /usr/games/, which is normally in $PATH).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.