45

I am using Ubuntu 14.04.2. I want to install the latest version of Octave (Octave 4.0.0 ). But in official Ubuntu repository ,there is only octave version 3.8 available for download/install.

How can I install Octave 4.0.0 safely/easily in Ubuntu 14.04.2?

I don't want to install/compile it directly from source which is available at official website, because I feel it is not easy method to install.

  • 2
    Please see the answer in this question for a manual installation: askubuntu.com/questions/138832/how-to-install-the-latest-octave – mdd Jul 7 '15 at 17:01
  • 1
    @MatthiasDiener hit it right on the head. The GNU Octave website says "The delay between an Octave source release and the availability of a package for a particular GNU/Linux distribution varies. The Octave project has no control over that process". That means that you either use 3.8 or install from source. I can't seem to find a PPA from the GNU Octave site, and I'm not sure it would be wise to trust any other PPA source for it. – Andrew Wallace Jul 7 '15 at 17:46
  • 1
    @AndrewWallace Did you find any ppa with Octave 4.0? I could only find ppas with 3.8. Even the Ubuntu wily packages are only at 3.8.2. – mdd Jul 7 '15 at 17:55
  • Upon further inspection, no, there were no PPAs for 4.0.0. – Andrew Wallace Jul 7 '15 at 19:25
  • use synaptic package manager and make your life easier – Sudip Bhandari Mar 21 '18 at 10:56
75

You have two options:

  1. Use the octave ppa, which already has the 4.0 version. You can install octave like this:

    sudo add-apt-repository ppa:octave/stable
    sudo apt-get update
    sudo apt-get install octave
    
  2. Download and compile the sources yourself:

    sudo apt-get build-dep octave
    wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
    tar xf octave-4.0.0.tar.gz
    cd octave-4.0.0/
    ./configure
    make 
    sudo make install
    
  • compiling from source method is not working... make step is giving error "No targets specified and no makefile found. " – Yuvaraj Jul 16 '15 at 18:11
  • This probably means that your configure step is not successful. Can you post the full error message? – mdd Jul 16 '15 at 18:15
  • An explanation might be that you miss the packages to build octave. Please try running sudo apt-get build-dep octave and run configure again. – mdd Jul 16 '15 at 18:20
  • I compiled the source as in 2. However I then get the problem as described here: askubuntu.com/questions/650396/… Any suggestion? – ZenoCosini Sep 21 '15 at 17:37
  • @MicheleV: Please use the ppa (as per my solution #1). It should be much easier to install, and it already contains the QT gui if I saw correctly. – mdd Sep 21 '15 at 17:40
4

You can try this, just type the following commands in terminal and compile the source easily:

sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-7-jdk libsndfile1-dev llvm-dev lpr texinfo libglu1-mesa-dev pstoedit libjack0 libjack-dev portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libsuitesparse-dev zlib1g-dev libxft-dev autoconf automake bison flex gperf gzip librsvg2-bin icoutils libtool perl rsync tar libosmesa6-dev libqt4-opengl-dev

wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
tar xf octave-4.0.0.tar.gz
rm octave-4.0.0.tar.gz
cd octave-4.0.0/
./configure
make -j4
sudo make install

This was OK for Ubuntu & Mint (you can use the command "make" without arguments if you are using a old computer).

  • This is what OP did NOT want. You suggest installing it from source. – Pilot6 Aug 9 '15 at 13:06
  • " (i don't want to install/compile it directly from source which is available at official website,because i feel it is not easy method to install ) " Do you think that copy & paste 8 lines is not easy? – Bendermh Aug 9 '15 at 13:23
  • But your method is exactly compiling directly from source. – Pilot6 Aug 9 '15 at 13:25
  • Yes Pilot6, it is a compiling from source method. But if you read the question, the only reason given by the user is that compiling in not easy... – Bendermh Aug 9 '15 at 13:28
  • 1
    @Bendermh: Did you just copy my answer?? – mdd Aug 16 '15 at 23:38
4

This worked for me at the end.

In terminal, install

sudo apt-get build-dep octave

In synaptic, install

libqt4-opengl-dev

Then, download octave-4.0.0.tar.gz from ftp://ftp.gnu.org/gnu/octave/

unzip octave-4.0.0.tar.gz to home.

cd octave-4.0.0
./configure
make
sudo make install

This worked on all the machines I tried in my laboratory.

2

Use this link:

Five simple instructions to compile Octave 4.0.0 on Ubuntu


  1. get necessary dev-tools

    sudo apt-get install g++ gcc gfortran make autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar
    
  2. get necessary packages

    sudo apt-get install libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++-dev libhdf5-serial-dev openjdk-7-jdk libsndfile1-dev llvm-dev lpr texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libsuitesparse-dev libxft-dev zlib1g-dev
    
  3. download and extract

    cd /tmp
    wget -c ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
    tar -xzf octave-4.0.0.tar.gz
    cd octave-4.0.0
    
  4. configure and make

    ./configure --prefix=/opt/octave-4.0.0 CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial
    make
    make check
    
  5. install

    sudo make install
    
  • 1
    This is a verbatim copy of the page you linked. Do you own the copyright? – guntbert Oct 14 '15 at 18:42
2

I think you need fort77 compiler... try this:

sudo apt-get install g++ gcc fort77
sudo apt-get build-dep octave
wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.xz
tar Jxvf octave-4.0.0.tar.xz
cd octave-4.0.0
./configure
make
sudo make install
  • .. to install from the source you need fort77 pakage... and build-dep doesn't install the fortran compiler (that was my case) sorry for my English :/ – Ivan Nahin Feb 12 '16 at 8:32
1

You have two popular methods to install the latest octave. One is fast while other is slow. Installing from the binaries is fast. While installing from the source is rather complex and lengthy. Here both are here.

From Source

Open command terminal using this key CTRL+ALT+T

Type these commands

wget -c ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
tar xzvf octave-4.0.0.tar.gz
cd octave-4.0.0
.configure
make 
make install

Default installation location of octave is /usr/local/lib/octave

Default command location is /usr/local/bin/octave

you can see the help using this command

./configure --help

There is already file for installation instruction octave.installation in the source directory.

From Binaries using repository.

use these command to install the octave from binaries. It is fast and easy.

If you don't have java JDK and want to install the java JDK7. Then, use this command.

sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-7-jdk libsndfile1-dev llvm-dev lpr texinfo libglu1-mesa-dev pstoedit libjack0 libjack-dev portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libsuitesparse-dev zlib1g-dev libxft-dev autoconf automake bison flex gperf gzip librsvg2-bin icoutils libtool perl rsync tar libosmesa6-dev libqt4-opengl-dev

if you have java and don't want to install the java then use this command to install the necessary tools.

sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++1-dev libhdf5-serial-dev libsndfile1-dev llvm-dev lpr texinfo libglu1-mesa-dev pstoedit libjack0 libjack-dev portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libsuitesparse-dev zlib1g-dev libxft-dev autoconf automake bison flex gperf gzip librsvg2-bin icoutils libtool perl rsync tar libosmesa6-dev libqt4-opengl-dev

Add the PPA using this command.

sudo apt-add-repository ppa:octave/stable

Update the local repository

sudo apt-get update 

You can see the octave packges in the local repository

sudo apt-cache search "octave"

You will see the list which containing the octave. Install the latest the GNU octave using this command.

sudo apt-get install octave

Note You can also use the aptitude instead of apt-get. Aptitude command is more intelligent than the apt-get

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.