Gnu Octave finally offers official Snap package for Linux desktops, so far in beta, which means you can now easily install the latest Octave via Ubuntu Software and always keep updated.
Octave snap is a containerized software package comes with run-time libraries bundled and auto-updates itself once a new version package is published.
For Ubuntu 18.04 and higher, the snap can be directly installed from Ubuntu Software utility:
For Ubuntu 16.04, open terminal either via Ctrl+Alt+T or from application menu. When it opens, run command to install
snapd daemon first:
sudo apt-get install snapd
Then install Octave via command:
sudo snap install --beta octave
Snap co-exists with legacy packages, launch it via
snap run octave if both are installed.
(Optional) To remove the package, either use Ubuntu Software or run command in terminal:
sudo snap remove octave