How To Install python-cmdln on CentOS 7

In this tutorial we learn how to install python-cmdln on CentOS 7. python-cmdln is An improved cmd.py for Writing Multi-command Scripts and Shells

Introduction

In this tutorial we learn how to install python-cmdln on CentOS 7.

What is python-cmdln

cmdln.py is an extension of Python’s default cmd.py module that provides “a simple framework for writing line-oriented command interpreters”. The idea (with both cmd.py and cmdln.py) is to be able to quickly build multi-sub-command tools (think cvs or svn) and/or simple interactive shells (think gdb or pdb). Cmdln’s extensions make it more natural to write sub-commands, integrate optparse for simple option processing, and make having good command documentation easier.

We can use yum or dnf to install python-cmdln on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python-cmdln.

Install python-cmdln on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python-cmdln

Install python-cmdln on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install python-cmdln using dnf by running the following command:

sudo dnf -y install python-cmdln

How To Uninstall python-cmdln on CentOS 7

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

sudo dnf remove python-cmdln

References

Summary

In this tutorial we learn how to install python-cmdln on CentOS 7 using yum and dnf.