8

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?

Braiam
  • 67,791
  • 32
  • 179
  • 269

6 Answers6

11

This PPA should solve your problem, provided you are running the latest 12.04.

Open Terminal Ctrl-Alt-T and type:

sudo apt-add-repository -y ppa:picaso/octave
sudo apt-get update 
sudo apt-get install octave
sudo apt-get install liboctave-dev 

For Ubuntu 20.04, see this answer.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
ish
  • 139,926
  • even after update the repositories are not showing octave 3.6. I am searching in both synaptic and apt-get – prometheuspk May 18 '12 at 09:47
  • What version of Ubuntu are you running? – ish May 18 '12 at 09:48
  • Ubuntu 10.04 LTS – prometheuspk May 18 '12 at 09:49
  • Repos in both answers are for 12.04 LTS only :(. Can you upgrade? – ish May 18 '12 at 09:52
  • will soon. Finals are in progress. after that. – prometheuspk May 18 '12 at 09:57
  • but can you describe how ppa's can be restricted to ubuntu versions? – prometheuspk May 18 '12 at 09:57
  • 2
    PPAs must usually be restricted to specific versions because they contain binaries which have been compiled on that specific version, for that specific version. – ish May 18 '12 at 09:59
  • This ppa today brings us 3.6.1 version, newest available (stable) on GNUoctave site is 3.6.4 – yujaiyu Nov 21 '13 at 19:59
  • For 14.0.4.2, I had to use a bit of both answers:
    "sudo apt-add-repository -y ppa:picaso/octave"
    "sudo apt-get update "
    "sudo apt-get install octave"
    "sudo apt-get install liboctave-dev"
    
    

    These made octave 4.0 run, but not with --force-gui

    "sudo apt-get build-dep octave"
    
    

    was also required to get --force-gui to work. Screw this non-formatting of of comments.

    – rmustakos Aug 27 '15 at 18:46
7

The answer is quite simple. Go to the Octave downloads website and find the latest release of GNU Octave and download the .tar.gz file of it.

After this copy and paste the following terminal (CTRL+ALT+T) commands:

sudo apt-get build-dep octave
cd ~/Downloads
sudo mv octave-x.x.x.tar.gz ~
cd ~
tar xvf octave-x.x.x.tar.gz
cd octave-x.x.x
./configure
make
sudo make install

Where the 'x.x.x' refers to the version of GNU Octave you'd like to install, such as 3.6.3.

Josh Pinto
  • 7,919
3

Just as an update: this PPA (maintained by a member of the Debian Octave Group) provides the latest Octave for a range of Ubuntu versions.

pidge
  • 31
1

This does not use apt-get, but an alternative mechanism, flatpak, which has its own elaborate installation instructions, 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.

knb
  • 5,004
1

I am only "answering" this because I could not format in the comments. kudos to @izx and @Brenton Horne

For 14.0.4.2, I had to use a bit of both answers:

sudo apt-add-repository -y ppa:picaso/octave
sudo apt-get update
sudo apt-get install octave
sudo apt-get install liboctave-dev

These made octave 4.0 run, but not with --force-gui

sudo apt-get build-dep octave

was also required to get --force-gui to work.

A.B.
  • 90,397
rmustakos
  • 369
-3

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.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183