Latest version of octave is octave-4.0.0 which also supports GUI. In order to install octave-4.0.0, you need to install the following dependencies first:
1. Get necessary dev-tools
sudo apt-get install g++ gcc gfortran f2c 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
You can also use following to install required dependencies but it is much better to install all manually.
sudo apt-get build-dep octave
Also, Aside the octave package that installs GNU Octave, other pieces of it are split over multiple packages. These are octave-doc, octave-info, and octave-htmldoc for the documentation; liboctave-dev for the octave development header files and mkoctfile, which are required to install Octave Forge packages; and octave-dbg for the debugging symbols. Here, liboctave-dev depends on octave package, so install that first.
3. Download the package
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/local/octave-4.0.0 CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial --enable-jit CPPFLAGS=-I/usr/local/java/jdk1.8.0_40/jdk1.8.0_40 make make check
While configuring, you may get the following when building from source:
Warning: HDF5 library not found. Octave will not be able to save or load HDF5 data files.
The problem is that there are multiple versions of the hdf5 package. Octave was written with the serial version in mind but it is likely to work with the others (OpenMPI and Mpich). Due to the naming scheme done in Debian, it is required to specify the location of the libraries.
sudo make install
There may be case, where you’ll be asked to install some dependencies. If so, install those too. By default, when you start octave, from either the terminal or by double-clicking the icon, it starts in the GUI mode. For the command-line version of octave, start it like this:
With this you can run octave in command line mode.