9

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?

ZygD
  • 149
  • 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 04 '16 at 06:10

4 Answers4

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.

sgiri
  • 221
  • 4
  • 9
5

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.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
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 =

  -0.94444
  -0.11111
   0.72222

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

   9.50803
   0.77287

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
4

start without gui

octave --no-gui

For more options check out

octave --help
techraf
  • 5,941
2

A workaround for this problem was to install miniconda (no sudo needed) via

$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh

and then install octave package in a new conda environment via

$ conda create --name myoctave --channel conda-forge octave
$ source activate myoctave # or conda activate myoctave
(myoctave) $ octave-cli

afterwards you can delete the conda environment which will delete all octave packages without any trace for your linux system

(myoctave) $ source deactivate # conda deactivate
$ conda env remove --name myoctave
Levon
  • 151