Question: I want to install Octave on my Ubuntu LTS with `apt-get`. The problem is that the official repositories list only Octave 3.0 and Octave 3.2, whereas the latest Octave is Octave 3.6.

How do I update the repositories of apt-get to get Octave 3.6?

Answer: 
This does not use `apt-get`, but an alternative mechanism, `flatpak`, which has its own elaborate [installation instructions](https://flatpak.org/setup/), depending on Linux distribution and desktop environment used.

You can run the newest version of Octave (5.1.0 since March 2019) by running it as a Flatpak app. "Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux."

The installation procedure for the Octave package is described here: <https://flathub.org/apps/details/org.octave.Octave> (2 commands at bottom of page)

If you are on Ubuntu 16.04, You have to install flatpak first, then run Octave:

```
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt install flatpak
sudo apt install gnome-software-plugin-flatpak  # optional, AFAIK
flatpak install flathub org.octave.Octave
flatpak run org.octave.Octave --gui

```

This downloads about 1.5 GB from the internet, because it installs KDE dependencies as well.

On my machine, it installs this:

```
       ID                                            Branch        Download
 1. [|] org.kde.Sdk                                  5.12          < 825,1 MB
 2. [ ] org.freedesktop.Platform.html5-codecs         8.08         < 4,9 MB
 3. [ ] org.kde.Sdk.Locale                            5.12         < 337,3 MB (partial)
 4. [ ] org.octave.Octave                             stable       < 117,0 MB

```

Note that Octave 5.1.0 itself is only 117 MB.

To upgrade, I had to uninstall the octave flatpak, then run flatpak install.
Latest ppa is ppa:octave/stable.

<https://launchpad.net/~octave/+archive/ubuntu/stable>

This ppa is maitained by the "GNU Octave" team and has version 3.8.1 available for lucid and precise.