19

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?
Zanna
  • 69,223
  • 56
  • 216
  • 327
saidaspen
  • 547
  • 2
  • 4
  • 13
  • 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 03:13

2 Answers2

16

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).

Ali Razmdideh
  • 5,710
  • 2
  • 34
  • 51
  • 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 09: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 09:14
  • It worked. Successfully installed Octave 4.2.2 on Ubuntu 16.04. Thanks. – ddas Oct 20 '19 at 04:49
6

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

#!/bin/sh
flatpak run org.octave.Octave --gui

and /usr/share/octave-cli with content

#!/bin/sh
flatpak run org.octave.Octave
knb
  • 4,804
  • 4
  • 33
  • 40
  • 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 03 '19 at 07:15