Getting the latest stable version of Octave on Ubuntu PPA

The GNU Octave PPA will keep you up to date with the latest stable version of Octave, rather than compiling GNU Octave 4.

sudo apt-add-repository ppa:octave/stable
sudo apt update
sudo apt install octave liboctave-dev

Note: if you have Octave installed already, these commands will uninstall your old Octave and install the latest stable version of Octave.

Install addon packages in Octave

Install Octave packages by typing in Octave:

 pkg -verbose install -forge specfun

to install the specfun package, and so on. Prerequisite Octave Packages will automatically be installed, though outside libraries will need to be installed by you if required by an Octave package.

List the loaded Octave packages

Type in octave

pkg list

The loaded packages have an asterisk next to their name. You can stop Octave autoload of packages