Table of Contents
In this article, we will see the steps to install and play nSnake Game on Linux Terminal. I am sure in your childhood you must have played snake game in your system and mobile devices which was quite popular then and now also. There are lot of snakes games are available now if you want to play that classic game again then all you need to do is to install nsnake game in your Linux based system. nsnake is a small and simple game developed with ncurses by Alexandre Dantas. It is available in almost all the Linux distributions.
nSnake - Install and Play Classic Snake Game on Linux Terminal
Also Read: How to Install NVIDIA drivers on Ubuntu 20.04 LTS (Focal Fossa)
Step 1: Prerequisites
a) You should have a running Linux(in our case it is Ubuntu 20.04 LTS
) System.
b) You should have sudo
or root
access to run privileged commands.
c) You should have apt
or apt-get
utility available in your Server.
Step 2: Update Your Server
If you are also using Ubuntu/Debian based systems then first step is to update the System Cache with all the latest available updates from all the enabled repository using apt update
command. If any packages needs to be upgraded then run apt upgrade
command as well.
root@cyberithub:~# apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:5 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal InRelease
Hit:6 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Hit:7 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal InRelease
Get:8 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:9 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:10 http://download.opensuse.org/repositories/home:/selmf/xUbuntu_20.04 InRelease
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,744 kB]
Get:12 https://repo.protonvpn.com/debian stable InRelease [2,519 B]
......................................
Step 3: Install nSnake Game
In the next step, you can install nSnake Game using apt install nsnake
command as shown below. This will download and install the nsnake package along with all its dependencies from default Ubuntu repo.
root@cyberithub:~# apt install nsnake Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: nsnake 0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded. Need to get 111 kB of archives. After this operation, 407 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 nsnake amd64 3.0.1-2build4 [111 kB] Fetched 111 kB in 1s (210 kB/s) Selecting previously unselected package nsnake. (Reading database ... 205906 files and directories currently installed.) Preparing to unpack .../nsnake_3.0.1-2build4_amd64.deb ... Unpacking nsnake (3.0.1-2build4) ... Setting up nsnake (3.0.1-2build4) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Step 4: Export PATH
By default nsnake will be installed under /usr/games
directory. But since this path is not exported under PATH
environment variable so nsnake command won't be detected on the terminal. You need to first export the path using export PATH=$PATH:/usr/games
command as shown below.
It is important to note here that below step is just the temporary way to export the directory path as it will not work once the current terminal session is closed. So to make it permanent, you need to add an entry in either ~/.bashrc
or ~/.profile
file.
root@cyberithub:~# export PATH=$PATH:/usr/games
Step 5: Check Version
You can use nsnake --version
command to check the current installed version.
root@cyberithub:~# nsnake --version nsnake v3.0.0 (Mar2020) , , / \ This game was made with ((__-^^-,-^^-__)) and itself is Free Software, `-_---' `---_-' licensed under the GPLv3 `--|o` 'o|--' <3 \ ` / ): :( :o_o: - Homepage: http://nsnake.alexdantas.net/ Source Code: https://github.com/alexdantas/nsnake/ Contact: Alexandre Dantas <eu@alexdantas.net>
Step 6: Launch nSnake Game
You can use nsnake
command to launch the game from the Linux Terminal as shown below.
root@cyberithub:~# nsnake
You can go through all the Game settings and then once ready Press Enter
to Start. Once started, it should look like below. You can use the arrow keys to move left, right, up and down. To pause Press P
and to quit the game Press Q
.
Step 7: Uninstall nSnake Game
Once you are done with nSnake game, you can also choose to uninstall it from System by using apt remove nsnake
command as shown below.
root@cyberithub:~# apt remove nsnake Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: nsnake 0 upgraded, 0 newly installed, 1 to remove and 17 not upgraded. After this operation, 407 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 205954 files and directories currently installed.) Removing nsnake (3.0.1-2build4) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...