Linux Tactic

Unleashing the Power of GNU Octave: Installing and Managing External Packages

Introduction to GNU Octave

MATLAB is one of the most significant applications in engineering, science, and mathematics. It is proprietary software widely used in academia and industries for numerical computations and symbolic computing.

However, MATLAB has some limitations such as high costs associated with a license, which restricts its usage to specific users.

Another issue with MATLAB that affects a broad audience is the inability to modify its source code.

This means that users cannot tailor the software according to their specific requirements. These limitations inspired the creation of an open-source software alternative called GNU Octave.

GNU Octave has become very popular as it provides similar features to MATLAB for free. GNU Octave provides robust support for numerical computations, data analysis, and visualization, and the ability to modify its source code makes it extremely flexible.

The software is compatible with various operating systems, including Linux, Mac OS, and Windows. This article explores the installation methods for GNU Octave.

Installation Methods

There are three ways to install GNU Octave on Ubuntu operating systems. All these methods require an Internet connection to get the required files.

FlatPak installation method

FlatPak is a system that allows users to deploy Linux packages securely and runs applications in a sandbox. FlatPaks come with all necessary dependencies packaged inside a unique container.

Here is how you install Octave via the FlatPak method:

1. Type `sudo add-apt-repository ppa:flatpak/stable`


Then enter `sudo apt install flatpak`

3. Next, type `flatpak remote-add –if-not-exists flathub`


Finally, enter `flatpak install flathub org.octave.Octave`

Ubuntu Software Manager installation method

Another method for installing GNU Octave is through the Ubuntu Software Manager. Ubuntu Software Manager is the official app store for Ubuntu.

Here are the steps involved in using the Ubuntu Software Manager:

1. Open the Ubuntu Software Manager application


Search for GNU Octave in the search box

3. Click on the ‘Install’ button


Once installed, you can launch GNU Octave from the application menu

Apt Install method

The Apt method is a command-line utility for installing, updating, and managing software packages on Ubuntu. Here are the steps to install GNU Octave via the Apt method:


Open the terminal

2. Type `sudo apt-get update`


Then, type `sudo apt install octave`


In summary, these three methods are some of the most effective ways to install GNU Octave on Ubuntu. The

FlatPak installation method provides some extra security via sandboxing, while the Ubuntu Software Manager is the easiest method for users new to the Ubuntu operating system.

The Apt method is a preferred choice for advanced users who are already familiar with the command-line interface. No matter which method you choose, you are sure to enjoy the flexibility and power of GNU Octave.

GNU Octave is a numerical computing software that is highly praised for its capabilities in numerical analysis, data processing, and simulations. Although GNU Octave itself is a powerful software, customization to meet specific needs can be achieved by installing external third-party software packages.

In this article, we will discuss how to install, load, and uninstall external packages in GNU Octave.

Installing External Packages

An external package adds new functionality

to GNU Octave. Several packages are available for GNU Octave, which can be found in a package list by searching for ‘Octave Forge’.

The most straightforward way to install an external package is through the ‘pkg install’ command on the Octave terminal. First, we need to install the liboctave-dev package, which includes all the development files needed to build external packages.

To install the liboctave-dev package, open a terminal and type:


sudo apt-get install liboctave-dev


After installing the development package, we can now install an external package. Suppose we want to install ‘image’, which is an external package that provides image processing and computer vision functions.

We can install the image package by running the following command on the Octave terminal:


pkg install -forge image


It will prompt with a message asking you to confirm the installation. Once installed, the package and its dependencies will be automatically downloaded and installed.

Loading a Package

After installing an external package, we must load it to use its functions. The load() command refers to Octave’s default loading function, which allows Octave to import variables, functions, and scripts from files.

However, in Octave, we prefer using the ‘pkg load’ command to load installed external packages. We can load the previously installed ‘image’ package by running the following command:


pkg load image


Now, all the functions and operations provided by the ‘image’ package can be used in the code. We can check the packages loaded via the ‘who’ command.

This command shows the names of all the variables in the current workspace and also includes the loaded packages.

Uninstalling a Package

If you want to remove an external package, Octave provides us with an uninstallation command. Removing a package can be done using the ‘pkg uninstall’ command.

The following command will remove the previously installed ‘image’ package:


pkg uninstall image


Octave will prompt a message querying the user to confirm the uninstallation of the package. Once confirmed, Octave will remove the package with all its dependencies.


In conclusion, by installing external packages in GNU Octave, we can increase its functionality and features. There are various packages available in the package list that can be installed easily via the command line.

After installation, we must load the package through the ‘pkg load’ command, and we can then use the package’s functions in the code. If we later find the package no longer necessary, we can uninstall it via the ‘pkg uninstall’ command.

These features add to the ease of use of GNU Octave and make it a perfect scientific and numerical computing tool. In summary, external packages are fundamental in extending GNU Octave’s capabilities.

By installing a package, we can add functionality such as image processing and computer vision, making it a perfect tool for numerical computation and scientific computing. We can download, install, and manage packages via the terminal, allowing users to tailor the software to their specific needs.

Furthermore, we can unload the package when it is no longer relevant. The availability of these packages, coupled with the ease of installation and use, makes GNU Octave a strong contender in the field of numerical computation.

Popular Posts