I am really angry. Just installed the new ubuntu and run apt-get install octave. I got tons of crap installed (like Java, some QT libraries, and other pollution).

How can I install Octave in Ubuntu 16.04 without the dependency to any GUI stuff? If the latest version of Octave does not have a "clean" package, then how to install an old version which does not have the GUI?

  • 2
    You are still able to run Octave in command line if you do such an installation. And such stuff like Java, Qt etc may be needed when installing other software, so just keep it – trolley813 Apr 30 '16 at 13:49
  • 3
    submit a bug report asking for an octave-cli package without Qt/Java/etc. – cas May 4 '16 at 6:10

Don't be angry :)

I installed GNU Octave, version 4.0.0 on my fresh Ubuntu 16.04 LTS

Here's how you can install it in your system:

  1. Using PPA

sudo apt-add-repository ppa:octave/stable sudo apt-get update sudo apt-get install octave

  1. Compiling the source 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

Run octave-cli on your terminal to verify.

Choose what option fits you. I used PPA, coz it's simple.

  • Does that adress the “without GUI” part in any way? – leftaroundabout Jun 12 '16 at 18:15
  • 1
    Why do you need to use PPA? Isnt the conventional method just to use sudo apt-get install octave? – alpha_989 Nov 26 '17 at 3:42

start without gui

octave --no-gui

For more options check out

octave --help

You can install Octave from source without any GUI stuff.

$ wget -c ftp://ftp.gnu.org/gnu/octave/octave-4.2.1.tar.xz
$ tar -xf octave-4.2.1.tar.gz

(or newer version, depending on what you want)

$ cd octave-4.2.1/
$ ./configure --without-java

The configure script will likely give you a bunch of errors and/or warnings because of missing dependencies. In fact Octave is quite forgiving with missing libraries, but a few are obviously required or at least highly advisable to have. I would at least

$ sudo apt-get install gfortran libfftw3-dev libfltk1.3-dev libarpack2-dev libqrupdate-dev libreadline-dev texinfo

Then again ./configure --without-java. It may still give errors, depending on what you have already installed on your system. The standard rule is: for e.g.

configure: WARNING: FFTW3 library not found.

fetch the library with sudo apt-get install libfftw3-dev.

Once the configure script runs with no warnings except those relating to GUI, Java, audio, or logos, you can start the build:

$ make

This will take some time. If you're in a hurry and/or have some CPU cores to spend, use make -j4 for quadruply-parallel compilation.

Once this is done, check that everything works with e.g.

$ ./run-octave
GNU Octave, version 4.0.0
Copyright (C) 2015 John W. Eaton and others.
This is free software; see the source code for copying conditions.
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-unknown-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> [1 2 3; 4 5 6]
ans =

   1   2   3
   4   5   6

octave:2> [1 2 3; 4 5 6] \ [1; 0]
ans =


octave:3> svd([1 2 3; 4 5 6])
ans =


If something doesn't work yet, you may wish to install more libraries, then configure and $ make again. (Perhaps you first need to $ make clean so it actually builds anew, not sure about this.)

If it works to your satisfaction, finally bake the install to your system:

$ sudo make install

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.