I have installed Gnu Octave by using apt-get install octave.
This installed version 4.0.3 on my machine.

I want to install the latest available version. How can I:

  1. Uninstall the version I have?
  2. Install the latest version?
  • Which version of Ubuntu do you use ? \\ if you are using zesty (17.04) you can use this commands for adding this repository sudo sed -i 's/zesty/xenial/g' /etc/apt/sources.list.d/octave-ubuntu-stable-zesty.list && sudo apt update – Ali Razmdideh Aug 13 '17 at 3:13

For uninstalling GNU Octave you can run this command:

sudo apt purge octave

But you don't need to remove and then install latest version of Octave.

You can easily upgrade that package with this commands:

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

These commands upgrade Octave to latest stable version of this software (with no need to remove current version).

| improve this answer | |
  • After running this, it says: octave is already the newest version (4.0.3-3ubuntu1). However on octaves webpage it says that 4.2.1 has been released :( – saidaspen Aug 12 '17 at 9:20
  • 1
    If a new software is released upstream (by the original authors) it is not automatically in the Ubuntu repository. The Ubuntu maintainers have to create the packages and so on. Within a Ubuntu release (i.e. 18.04) packages only get security updates and few packages get major updates like firefox, thunderbird, chromium. – tardis Jul 18 '18 at 9:14
  • It worked. Successfully installed Octave 4.2.2 on Ubuntu 16.04. Thanks. – ddas Oct 20 '19 at 4:49

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

The installation procedure is described here: https://flathub.org/apps/details/org.octave.Octave at the bottom of the page.

A more complete set of commands looks like the following section:

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

sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt install flatpak
# optional line, AFAIK (pulls in Gnome deps?):
sudo apt install gnome-software-plugin-flatpak  
# this line possibly required on Debian systems
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo  
flatpak install flathub org.octave.Octave
flatpak run org.octave.Octave --gui

This downloads about 900 MB from the internet.

For convenience in starting Octave from the command line, you can create the files /usr/share/octave with the contents

flatpak run org.octave.Octave --gui

and /usr/share/octave-cli with content

flatpak run org.octave.Octave
| improve this answer | |
  • on my Debian stretch (9, stable) you also must add the repo, which is done by flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo – tverrbjelke May 3 '19 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.