当我发出
sudo apt-get install octave
它安装了 octave 4.0.0。但是我们的老师告诉我们这个版本有问题,我们必须安装 4.0.1 版本。所以我检查了包管理器可用的版本:
mzh:~ $ sudo apt-cache madison octave
octave | 4.0.0-3ubuntu9.1 | http://ch.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
octave | 4.0.0-3ubuntu9 | http://ch.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
看起来只有 4.0.0 可用。我该怎么做才能安装 4.0.1?
答案1
我来这里可能也是出于同样的原因......
获取最新版本(目前为 4.2.1):
sudo add-apt-repository ppa:octave/stable
sudo apt update
sudo apt install octave
答案2
你应该从源代码编译它
首先确保所有依赖项都已安装:
sudo apt-get install default-jdk default-jdk-headless epstool gperf hdf5-helpers javahelper libaec-dev libarpack2-dev libblas-dev libbtf1.2.1 libcsparse3.1.4 libexif-dev libfftw3-dev libflac-dev libfltk-cairo1.3 libfltk-forms1.3 libfltk-images1.3 libfltk1.3-dev libftgl-dev libftgl2 libglpk-dev libgraphicsmagick++1-dev libgraphicsmagick1-dev libhdf5-cpp-11 libhdf5-dev libjack-dev libjasper-dev libklu1.3.3 liblapack-dev libldl2.2.1 libogg-dev libosmesa6-dev libportaudiocpp0 libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-designer libqt4-dev libqt4-dev-bin libqt4-help libqt4-opengl-dev libqt4-qt3support libqt4-scripttools libqt4-svg libqt4-test libsndfile1-dev libspqr2.0.2 libsuitesparse-dev libvorbis-dev libwmf-dev openjdk-8-jdk openjdk-8-jdk-headless portaudio19-dev qt4-linguist-tools qt4-qmake uuid-dev llvm-3.5-dev
据我所知,简单的方法sudo apt-get build-dep octave
似乎不再有效
然后 :
wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.1.tar.gz
tar xf octave-4.0.1.tar.gz
rm octave-4.0.1.tar.gz
cd octave-4.0.1/
./configure
make -j8
sudo make install
顺便说一句,我建议您使用最新版本的octave
。