How to install the latest Octave

This PPA should solve your problem, provided you are running the latest 12.04.

Open Terminal Ctrl-Alt-T and type:

sudo apt-add-repository -y ppa:picaso/octave
sudo apt-get update 
sudo apt-get install octave
sudo apt-get install liboctave-dev 

For Ubuntu 20.04, see this answer.


The answer is quite simple. Go to the Octave downloads website and find the latest release of GNU Octave and download the .tar.gz file of it.

After this copy and paste the following terminal (CTRL+ALT+T) commands:

sudo apt-get build-dep octave
cd ~/Downloads
sudo mv octave-x.x.x.tar.gz ~
cd ~
tar xvf octave-x.x.x.tar.gz
cd octave-x.x.x
./configure
make
sudo make install

Where the 'x.x.x' refers to the version of GNU Octave you'd like to install, such as 3.6.3.


Just as an update: this PPA (maintained by a member of the Debian Octave Group) provides the latest Octave for a range of Ubuntu versions.


I am only "answering" this because I could not format in the comments. kudos to @izx and @Brenton Horne

For 14.0.4.2, I had to use a bit of both answers:

sudo apt-add-repository -y ppa:picaso/octave
sudo apt-get update
sudo apt-get install octave
sudo apt-get install liboctave-dev

These made octave 4.0 run, but not with --force-gui

sudo apt-get build-dep octave

was also required to get --force-gui to work.