How To Install python-dialog on Ubuntu 18.04

In this tutorial we learn how to install python-dialog on Ubuntu 18.04. python-dialog is Python 2 module for making simple terminal-based user interfaces

Introduction

In this tutorial we learn how to install python-dialog on Ubuntu 18.04.

What is python-dialog

python-dialog is:

pythondialog is a Python wrapper for the dialog utility originally written by Savio Lam, and later rewritten by Thomas E. Dickey. Its purpose is to provide an easy to use, pythonic and comprehensive Python interface to dialog. This allows one to make simple text-mode user interfaces on Unix-like systems.

pythondialog provides dialog boxes (widgets) of many different types. Among these, one can find infobox, msgbox, yesno, menu, checklist, radiolist, fselect (for selecting a file), rangebox, buildlist, treeview, calendar. These widgets, and those not listed here, allow one to build nice interfaces quickly and easily. However, it is not possible to create new widgets without modifying dialog itself.

For most widgets, the following settings can be chosen:

  • width, height and other parameters where applicable;
  • two user-defined buttons, referred to as “Help” and “Extra”, may be added and their labels freely chosen. Additionally, a color theme may be defined for all widgets via a configuration file.

pythondialog has good Unicode support. Precisely, this support should be as good as allowed by the combination of the Python interpreter, dialog, the terminal and the locale settings in use.

This version is a backport of pythondialog to Python 2. Unless you really have to use Python 2, you should use the python3-dialog package.

There are three methods to install python-dialog on Ubuntu 18.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 python-dialog Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install python-dialog

Install python-dialog Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-dialog

Install python-dialog 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 python-dialog using aptitude by running the following command:

sudo aptitude -y install python-dialog

How To Uninstall python-dialog on Ubuntu 18.04

To uninstall only the python-dialog package we can use the following command:

sudo apt-get remove python-dialog

Uninstall python-dialog And Its Dependencies

To uninstall python-dialog and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-dialog

Remove python-dialog Configurations and Data

To remove python-dialog configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-dialog

Remove python-dialog configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-dialog

References

Summary

In this tutorial we learn how to install python-dialog package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.