我安装了 Octave 4.0.3 版本,但不知为何命令窗口没有显示任何文本。我不知道为什么我决定清除安装并重新开始,因为我以为我搞砸了某个地方
这是我执行的命令-
sudo apt-get purge --auto-remove octave
但这在重新安装 Octave 时出现了错误,所以我这样做了 -
sudo dpkg --list | grep octave
sudo dpkg --remove liboctave3:amd64
sudo dpkg --remove octave
sudo dpkg --remove octave-common
sudo dpkg --remove octave-info
因为列表中出现了这 4 个
之后我再次运行这个并清除了出现的包 -
sudo dpkg --list | grep octave
sudo dpkg --purge liboctave3:amd64
sudo dpkg --purge octave-common
运行此程序时 -
sudo apt-get -f install
我收到一个错误,说我的 /usr/local/share/octave/packages 不存在,因此根据一些论坛回复,我手动删除了主路径和 /usr/local/share/octave/ 路径中的整个 octave 文件夹,使用
cd /usr/local/share/
sudo rm -r octave
当我收到更多错误时,我做了 -
sudo apt-get autoclean
现在开始跑步——
sudo apt-get build-dep octave
我得到以下信息 -
[sudo] password for lightweight-autonomy:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up octave (4.0.2-1ubuntu5~octave~trusty1) ...
warning: docstring file '/usr/local/share/octave/4.0.3/etc/built-in-docstrings' not found
error: feval: function 'gnuplot_binary' not found
error: called from
/usr/local/lib/octave/4.0.3/oct/x86_64-pc-linux-gnu/PKG_ADD at line 5 column 1
error: octave_base_value::convert_to_str_internal (): wrong type argument '<unknown type>'
error: called from
/usr/local/lib/octave/4.0.3/oct/x86_64-pc-linux-gnu/PKG_ADD at line 5 column 1
dpkg: error processing package octave (--configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
E: Failed to process build dependencies
请帮助我,因为我需要安装 Octave,但找不到任何可以帮助我的东西。
抱歉发了这么长的帖子,但我觉得我必须列出我做过的所有导致我陷入这种境地的蠢事。我是新手,我真的希望有办法重新开始。谢谢。
答案1
所以我终于解决了这个问题。我使用了以下方法 -
sudo apt-get autoremove octave
sudo apt-get update
sudo apt-get upgrade
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
然后在我解压 tar 文件的目录中 -
./configure
make
sudo make install
重要提示:我以前做过这些事情,但是没有使用 sudo apt-get update/upgrade 命令,因此导致了问题。所以这绝对是一个重要的步骤。