nSnake - Install and Play Classic Snake Game on Linux Terminal | CyberITHub (2024)

by cyberithub

Table of Contents

Advertisem*nts

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 | CyberITHub (1)

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 updateHit:1 http://in.archive.ubuntu.com/ubuntu focal InReleaseGet: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 InReleaseHit:6 http://apt.postgresql.org/pub/repos/apt focal-pgdg InReleaseHit:7 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal InReleaseGet:8 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]Hit:9 https://dl.google.com/linux/chrome/deb stable InReleaseHit:10 http://download.opensuse.org/repositories/home:/selmf/xUbuntu_20.04 InReleaseGet: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 nsnakeReading package lists... DoneBuilding dependency treeReading state information... DoneThe following NEW packages will be installed:nsnake0 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 --versionnsnake 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:~# nsnakenSnake - Install and Play Classic Snake Game on Linux Terminal | CyberITHub (2)

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.

nSnake - Install and Play Classic Snake Game on Linux Terminal | CyberITHub (3)

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 nsnakeReading package lists... DoneBuilding dependency treeReading state information... DoneThe following packages will be REMOVED:nsnake0 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) ...
nSnake - Install and Play Classic Snake Game on Linux Terminal | CyberITHub (2024)

References

Top Articles
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 5638

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.