How To Install mwrap on Ubuntu 22.04

In this tutorial we learn how to install mwrap on Ubuntu 22.04. mwrap is Octave/MATLAB mex generator

Introduction

In this tutorial we learn how to install mwrap on Ubuntu 22.04.

What is mwrap

mwrap is:

MWrap is an interface generation system in the spirit of SWIG or matwrap. From a set of augmented Octave/MATLAB script files, MWrap will generate a MEX gateway to desired C/C++ function calls and Octave/MATLAB function files to access that gateway. The details of converting to and from Octave/MATLAB’s data structures, and of allocating and freeing temporary storage, are hidden from the user.

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

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

sudo apt-get update

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

sudo apt-get -y install mwrap

Install mwrap Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install mwrap using apt by running the following command:

sudo apt -y install mwrap

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

sudo aptitude -y install mwrap

How To Uninstall mwrap on Ubuntu 22.04

To uninstall only the mwrap package we can use the following command:

sudo apt-get remove mwrap

Uninstall mwrap And Its Dependencies

To uninstall mwrap and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove mwrap

Remove mwrap Configurations and Data

To remove mwrap configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge mwrap

Remove mwrap configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge mwrap

References

Summary

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