Installing latest version of GNU Octave when I have already installed other version

20,668

Solution 1

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

Solution 2

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
Share:
20,668

Related videos on Youtube

saidaspen
Author by

saidaspen

Updated on September 18, 2022

Comments

  • saidaspen
    saidaspen over 1 year

    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?
    • Ali Razmdideh
      Ali Razmdideh over 6 years
      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
  • saidaspen
    saidaspen over 6 years
    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 :(
  • tardis
    tardis almost 6 years
    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.
  • tverrbjelke
    tverrbjelke about 5 years
    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
  • ddas
    ddas over 4 years
    It worked. Successfully installed Octave 4.2.2 on Ubuntu 16.04. Thanks.