How To Install mah-jong on Ubuntu 20.04

In this tutorial we learn how to install mah-jong on Ubuntu 20.04. mah-jong is Original Mah-Jong game

Introduction

In this tutorial we learn how to install mah-jong on Ubuntu 20.04.

What is mah-jong

mah-jong is:

This is a set of programs to play the original Mah-Jong game: one server, one client for a human player and one client for an AI player. Hence the game can be played by 1 to 4 human players.

You should keep in mind that the original Mah-Jong game has nothing to do with the well-known solitaire game. (It merely uses the same set of tiles.)

If you like the game, please consider making a donation to the (upstream) author. Read /usr/share/doc/mah-jong/README.Debian for details.

There are three methods to install mah-jong on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install mah-jong Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install mah-jong using apt-get by running the following command:

sudo apt-get -y install mah-jong

Install mah-jong Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install mah-jong using apt by running the following command:

sudo apt -y install mah-jong

Install mah-jong Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install mah-jong using aptitude by running the following command:

sudo aptitude -y install mah-jong

How To Uninstall mah-jong on Ubuntu 20.04

To uninstall only the mah-jong package we can use the following command:

sudo apt-get remove mah-jong

Uninstall mah-jong And Its Dependencies

To uninstall mah-jong and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove mah-jong

Remove mah-jong Configurations and Data

To remove mah-jong configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge mah-jong

Remove mah-jong configuration, data, and all of its dependencies

We can use the following command to remove mah-jong configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge mah-jong

References

Summary

In this tutorial we learn how to install mah-jong package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.