如何在 Ubuntu 16.04 中安装没有 GUI 的 Octave?

oct*_*nus 9 ubuntu software-installation octave

我真的很生气。刚刚安装了新的 ubuntu 并运行apt-get install octave. 我安装了大量垃圾(如 Java、一些 QT 库和其他污染)。

如何在不依赖任何 GUI 内容的情况下在 Ubuntu 16.04 中安装 Octave?如果最新版本的 Octave 没有“干净”的软件包,那么如何安装没有 GUI 的旧版本?

小智 10

不要生气:)

我安装GNU Octave, version 4.0.0在我的新 Ubuntu 16.04 LTS 上

以下是在系统中安装它的方法:

  1. 使用PPA

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

  1. 自己编译源码

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

octave-cli在您的终端上运行以进行验证。


选择适合您的选项。我使用了 PPA,因为它很简单。


lef*_*out 5

您可以从源代码安装 Octave,无需任何 GUI 内容。

$ wget -c ftp://ftp.gnu.org/gnu/octave/octave-4.2.1.tar.xz
$ tar -xf octave-4.2.1.tar.gz
Run Code Online (Sandbox Code Playgroud)

(或更新版本,取决于你想要什么)

$ cd octave-4.2.1/
$ ./configure --without-java
Run Code Online (Sandbox Code Playgroud)

由于缺少依赖项,配置脚本可能会给你一堆错误和/或警告。事实上,Octave 对缺少的库非常宽容,但显然需要或至少非常建议拥有一些库。我至少会

$ sudo apt-get install gfortran libfftw3-dev libfltk1.3-dev libarpack2-dev libqrupdate-dev libreadline-dev texinfo
Run Code Online (Sandbox Code Playgroud)

然后呢./configure --without-java。它可能仍会出错,具体取决于您已在系统上安装的内容。标准规则是:例如

configure: WARNING: FFTW3 library not found.
Run Code Online (Sandbox Code Playgroud)

使用 获取库sudo apt-get install libfftw3-dev

一旦配置脚本运行时除了与 GUI、Java、音频或徽标相关的警告之外没有任何警告,您就可以开始构建:

$ make
Run Code Online (Sandbox Code Playgroud)

这将需要一些时间。如果您赶时间和/或有一些 CPU 内核要花费,请make -j4用于四重并行编译。

完成后,检查一切是否正常工作,例如

$ ./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
Run Code Online (Sandbox Code Playgroud)

如果某些东西还不起作用,您可能希望安装更多库,然后重新配置$ make。(也许您首先需要$ make clean这样它实际上重新构建,对此不确定。)

如果它让您满意,最后将安装烘焙到您的系统:

$ sudo make install
Run Code Online (Sandbox Code Playgroud)


小智 5

开始没有gui

octave --no-gui
Run Code Online (Sandbox Code Playgroud)

有关更多选项,请查看

octave --help
Run Code Online (Sandbox Code Playgroud)