How To Install lua-torch-cwrap on Ubuntu 18.04

In this tutorial we learn how to install lua-torch-cwrap on Ubuntu 18.04. lua-torch-cwrap is CWrap package for Torch Framework

Introduction

In this tutorial we learn how to install lua-torch-cwrap on Ubuntu 18.04.

What is lua-torch-cwrap

lua-torch-cwrap is:

The cwrap package helps you to automate the generation of Lua/C wrappers around existing C functions, such that these functions would be callable from Lua. This package is used by the torch package, but does not depend on anything, and could be used by anyone using Lua.

There are three methods to install lua-torch-cwrap 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 lua-torch-cwrap Using apt-get

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

sudo apt-get update

After updating apt database, We can install lua-torch-cwrap using apt-get by running the following command:

sudo apt-get -y install lua-torch-cwrap

Install lua-torch-cwrap Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install lua-torch-cwrap using apt by running the following command:

sudo apt -y install lua-torch-cwrap

Install lua-torch-cwrap 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 lua-torch-cwrap using aptitude by running the following command:

sudo aptitude -y install lua-torch-cwrap

How To Uninstall lua-torch-cwrap on Ubuntu 18.04

To uninstall only the lua-torch-cwrap package we can use the following command:

sudo apt-get remove lua-torch-cwrap

Uninstall lua-torch-cwrap And Its Dependencies

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

sudo apt-get -y autoremove lua-torch-cwrap

Remove lua-torch-cwrap Configurations and Data

To remove lua-torch-cwrap configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge lua-torch-cwrap

Remove lua-torch-cwrap configuration, data, and all of its dependencies

We can use the following command to remove lua-torch-cwrap configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge lua-torch-cwrap

References

Summary

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