当 libreadline 安装到 /usr/local/ 时 Octave 安装出现错误

当 libreadline 安装到 /usr/local/ 时 Octave 安装出现错误

几个月前我安装了 Octave 3.8.1,发现 GNU readline 无法正常工作。我尝试重新安装 Octave 3.8.0,但现在 GNU readline 无法在之前的版本上运行。在我安装 3.8.1 之前,GNU readline 在 Octave 3.8.0 上可以正常工作。我尝试安装 GNU readline 和 ncursers,但 sudo Make 无法识别 readline 和 ncursers 的存在。

/usr/local/lib/libreadline.so.6: undefined reference to `tgetstr'
/usr/local/lib/libreadline.so.6: undefined reference to `tputs'
/usr/local/lib/libreadline.so.6: undefined reference to `BC'
/usr/local/lib/libreadline.so.6: undefined reference to `tgetent'
/usr/local/lib/libreadline.so.6: undefined reference to `tgetflag'
/usr/local/lib/libreadline.so.6: undefined reference to `tgoto'
/usr/local/lib/libreadline.so.6: undefined reference to `UP'
/usr/local/lib/libreadline.so.6: undefined reference to `tgetnum'
/usr/local/lib/libreadline.so.6: undefined reference to `PC'
collect2: ld returned 1 exit status
make[2]: *** [octave-cli] Error 1
make[2]: Leaving directory `/home/gin/Downloads/octave-3.8.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gin/Downloads/octave-3.8.0'
make: *** [all] Error 2

以下是我电脑上安装的 readline 的 synaptic 包。 阅读行 以下是我电脑上安装的 ncursers 的 synaptic 包。 ncursers

有人能解决这个问题吗?谢谢。

下面是我的 readline 文件所在的目录。

@:/usr/local/lib$ ls
libhistory.a           libpcreposix.a            libreadline.so.6.3.old
libhistory.old         libpcreposix.la           libSDL2-2.0.so.0
libhistory.so          libpcreposix.so           libSDL2-2.0.so.0.1.0
libhistory.so.6        libpcreposix.so.0         libSDL2.a
libhistory.so.6.3      libpcreposix.so.0.0.2     libSDL2.la
libhistory.so.6.3.old  libpcre.so                libSDL2main.a
liblua.a               libpcre.so.1              libSDL2.so
libpcre.a              libpcre.so.1.2.2          libSDL2_test.a
libpcrecpp.a           libreadline.a             lua
libpcrecpp.la          libreadline.old           octave
libpcrecpp.so          libreadline_problem.so.6  pkgconfig
libpcrecpp.so.0        libreadline.so            python2.7
libpcrecpp.so.0.0.0    libreadline.so.6          vmd
libpcre.la             libreadline.so.6.3

我尝试了 bain 的解决方案。我收到了以下安装错误。

$ sudo find /usr/local -name '*octave*' -exec rm -f {} \;
rm: cannot remove `/usr/local/include/octave-3.8.0': Is a directory
rm: cannot remove `/usr/local/include/octave-3.8.0/octave': Is a directory
rm: cannot remove `/usr/local/include/octave-3.8.1': Is a directory
rm: cannot remove `/usr/local/include/octave-3.8.1/octave': Is a directory
rm: cannot remove `/usr/local/libexec/octave': Is a directory
rm: cannot remove `/usr/local/lib/octave': Is a directory
rm: cannot remove `/usr/local/share/octave': Is a directory
rm: cannot remove `/usr/local/share/octave/3.8.1/etc/tests/liboctave': Is a directory
rm: cannot remove `/usr/local/share/octave/3.8.1/etc/tests/libinterp/octave-value': Is a directory
rm: cannot remove `/usr/local/share/octave/3.8.0/etc/tests/liboctave': Is a directory
rm: cannot remove `/usr/local/share/octave/3.8.0/etc/tests/libinterp/octave-value': Is a directory

$ sudo apt-get install octave
...
Errors were encountered while processing:
 octave
E: Sub-process /usr/bin/dpkg returned an error code (1)

第三张图片 第三张图片

第四张图片 第四张图片

下面是在 Octave 的清除安装过程中重新创建的 readline.so.6

$:/usr/local/lib$ ls
libhistory.a           libpcrecpp.a         libpcreposix.so        libreadline.so          libSDL2main.a
libhistory.old         libpcrecpp.la        libpcreposix.so.0      libreadline.so.6        libSDL2.so
libhistory.so          libpcrecpp.so        libpcreposix.so.0.0.2  libreadline.so.6.3      libSDL2_test.a
libhistory.so.6        libpcrecpp.so.0      libpcre.so             libreadline.so.6.3.old  lua
libhistory.so.6.3      libpcrecpp.so.0.0.0  libpcre.so.1           libSDL2-2.0.so.0        pkgconfig
libhistory.so.6.3.old  libpcre.la           libpcre.so.1.2.2       libSDL2-2.0.so.0.1.0    python2.7
liblua.a               libpcreposix.a       libreadline.a          libSDL2.a               vmd
libpcre.a              libpcreposix.la      libreadline.old        libSDL2.la
$:/usr/local/lib$ sudo rm /usr/local/lib/libreadline.so.6
$:/usr/local/lib$ ls
libhistory.a           libpcrecpp.a         libpcreposix.so        libreadline.so          libSDL2.so
libhistory.old         libpcrecpp.la        libpcreposix.so.0      libreadline.so.6.3      libSDL2_test.a
libhistory.so          libpcrecpp.so        libpcreposix.so.0.0.2  libreadline.so.6.3.old  lua
libhistory.so.6        libpcrecpp.so.0      libpcre.so             libSDL2-2.0.so.0        pkgconfig
libhistory.so.6.3      libpcrecpp.so.0.0.0  libpcre.so.1           libSDL2-2.0.so.0.1.0    python2.7
libhistory.so.6.3.old  libpcre.la           libpcre.so.1.2.2       libSDL2.a               vmd
liblua.a               libpcreposix.a       libreadline.a          libSDL2.la
libpcre.a              libpcreposix.la      libreadline.old        libSDL2main.a
$:/usr/local/lib$ sudo apt-get purge '.*octave.*'
$:/usr/local/lib$ ls
libhistory.a           libpcrecpp.a         libpcreposix.so        libreadline.so          libSDL2main.a
libhistory.old         libpcrecpp.la        libpcreposix.so.0      libreadline.so.6        libSDL2.so
libhistory.so          libpcrecpp.so        libpcreposix.so.0.0.2  libreadline.so.6.3      libSDL2_test.a
libhistory.so.6        libpcrecpp.so.0      libpcre.so             libreadline.so.6.3.old  lua
libhistory.so.6.3      libpcrecpp.so.0.0.0  libpcre.so.1           libSDL2-2.0.so.0        pkgconfig
libhistory.so.6.3.old  libpcre.la           libpcre.so.1.2.2       libSDL2-2.0.so.0.1.0    python2.7
liblua.a               libpcreposix.a       libreadline.a          libSDL2.a               vmd
libpcre.a              libpcreposix.la      libreadline.old        libSDL2.la
$:/usr/local/lib$ sudo rm /usr/local/lib/libreadline.so.6
$:/usr/local/lib$ ls
libhistory.a           libpcrecpp.a         libpcreposix.so        libreadline.so          libSDL2.so
libhistory.old         libpcrecpp.la        libpcreposix.so.0      libreadline.so.6.3      libSDL2_test.a
libhistory.so          libpcrecpp.so        libpcreposix.so.0.0.2  libreadline.so.6.3.old  lua
libhistory.so.6        libpcrecpp.so.0      libpcre.so             libSDL2-2.0.so.0        pkgconfig
libhistory.so.6.3      libpcrecpp.so.0.0.0  libpcre.so.1           libSDL2-2.0.so.0.1.0    python2.7
libhistory.so.6.3.old  libpcre.la           libpcre.so.1.2.2       libSDL2.a               vmd
liblua.a               libpcreposix.a       libreadline.a          libSDL2.la
libpcre.a              libpcreposix.la      libreadline.old        libSDL2main.a
$:/usr/local/lib$ sudo apt-get install octave
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  units rtkit conky-std libpulsedsp libgsl0ldbl pulseaudio-utils
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  liboctave2 octave-common
Suggested packages:
  octave-info octave-doc octave-htmldoc
The following NEW packages will be installed:
  liboctave2 octave octave-common
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/12.3 MB of archives.
After this operation, 43.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
WARNING: The following packages cannot be authenticated!
  liboctave2 octave-common octave
Install these packages without verification [y/N]? y
Selecting previously unselected package liboctave2.
(Reading database ... 368749 files and directories currently installed.)
Unpacking liboctave2 (from .../liboctave2_3.8.1-1ubuntu1~octave1~precise1_amd64.deb) ...
Selecting previously unselected package octave-common.
Unpacking octave-common (from .../octave-common_3.8.1-1ubuntu1~octave1~precise1_all.deb) ...
Selecting previously unselected package octave.
Unpacking octave (from .../octave_3.8.1-1ubuntu1~octave1~precise1_amd64.deb) ...
Processing triggers for menu ...
Processing triggers for desktop-file-utils ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for gnome-menus ...
Processing triggers for man-db ...
Setting up liboctave2 (3.8.1-1ubuntu1~octave1~precise1) ...
Setting up octave-common (3.8.1-1ubuntu1~octave1~precise1) ...
Setting up octave (3.8.1-1ubuntu1~octave1~precise1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for menu ...
$:/usr/local/lib$ octave
/usr/bin/octave-cli: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
$:/usr/local/lib$ ls
libhistory.a           libpcrecpp.a         libpcreposix.so        libreadline.so          libSDL2main.a
libhistory.old         libpcrecpp.la        libpcreposix.so.0      libreadline.so.6        libSDL2.so
libhistory.so          libpcrecpp.so        libpcreposix.so.0.0.2  libreadline.so.6.3      libSDL2_test.a
libhistory.so.6        libpcrecpp.so.0      libpcre.so             libreadline.so.6.3.old  lua
libhistory.so.6.3      libpcrecpp.so.0.0.0  libpcre.so.1           libSDL2-2.0.so.0        pkgconfig
libhistory.so.6.3.old  libpcre.la           libpcre.so.1.2.2       libSDL2-2.0.so.0.1.0    python2.7
liblua.a               libpcreposix.a       libreadline.a          libSDL2.a               vmd
libpcre.a              libpcreposix.la      libreadline.old        libSDL2.la
$:/usr/local/lib$ 

以下是自 2014 年 5 月 9 日以来 bain 建议的命令:

$ sudo ppa-purge ppa:octave/stable
Updating packages lists
W: GPG error: http://us.archive.ubuntu.com precise Release: Unknown error executing gpgv
W: GPG error: http://repo.steampowered.com precise Release: Unknown error executing gpgv
W: GPG error: http://dl.google.com stable Release: Unknown error executing gpgv
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com precise-updates Release: Unknown error executing gpgv

W: GPG error: http://us.archive.ubuntu.com precise-backports Release: Unknown error executing gpgv
W: GPG error: http://packages.mate-desktop.org precise Release: Unknown error executing gpgv
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com precise-security Release: Unknown error executing gpgv

W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com precise Release: Unknown error executing gpgv

W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://deb.playonlinux.com maverick Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/Release  

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release  

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release  

W: Some index files failed to download. They have been ignored, or old ones used instead.
PPA to be removed: octave stable
comm: file 2 is not in sorted order
Package revert list generated:
 liboctave2/precise octave/precise octave-common/precise

Disabling octave PPA from /etc/apt/sources.list
Updating packages lists
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com precise-security Release: Unknown error executing gpgv

W: GPG error: http://repo.steampowered.com precise Release: Unknown error executing gpgv
W: GPG error: http://dl.google.com stable Release: Unknown error executing gpgv
W: GPG error: http://us.archive.ubuntu.com precise Release: Unknown error executing gpgv
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com precise-updates Release: Unknown error executing gpgv

W: GPG error: http://us.archive.ubuntu.com precise-backports Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com precise Release: Unknown error executing gpgv

W: GPG error: http://deb.playonlinux.com maverick Release: Unknown error executing gpgv
W: GPG error: http://packages.mate-desktop.org precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: GPG error: http://ppa.launchpad.net precise Release: Unknown error executing gpgv
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release  

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/Release  

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release  

W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Release 'precise' for 'liboctave2' was not found
Unable to find an archive "precise" for the package "liboctave2"
Unable to find an archive "precise" for the package "liboctave2"
The following packages will be DOWNGRADED:
  octave octave-common 
The following NEW packages will be installed:
  liboctave1{a} 
The following packages will be REMOVED:
  conky-std{u} libgsl0ldbl{u} liboctave2{u} libpulsedsp{u} pulseaudio-utils{u} rtkit{u} units{u} 
0 packages upgraded, 1 newly installed, 2 downgraded, 7 to remove and 0 not upgraded.
Need to get 0 B/11.1 MB of archives. After unpacking 10.6 MB will be freed.
Do you want to continue? [Y/n/?]  Y
WARNING: untrusted versions of the following packages will be installed!

Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.

  octave-common octave liboctave1 

Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": Yes
(Reading database ... 370422 files and directories currently installed.)
Removing conky-std ...
Removing libgsl0ldbl ...
Processing triggers for man-db ...
Processing triggers for menu ...
Processing triggers for doc-base ...
Processing 1 removed doc-base file...
Registering documents with scrollkeeper...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Selecting previously unselected package liboctave1.
(Reading database ... 370388 files and directories currently installed.)
Unpacking liboctave1 (from .../liboctave1_3.6.1-1ubuntu1ppa1~precise1_amd64.deb) ...
dpkg: warning: downgrading octave from 3.8.1-1ubuntu1~octave1~precise1 to 3.6.1-1ubuntu1ppa1~precise1.
Preparing to replace octave 3.8.1-1ubuntu1~octave1~precise1 (using .../octave_3.6.1-1ubuntu1ppa1~precise1_amd64.deb) ...
Unpacking replacement octave ...
dpkg: warning: downgrading octave-common from 3.8.1-1ubuntu1~octave1~precise1 to 3.6.1-1ubuntu1ppa1~precise1.
Preparing to replace octave-common 3.8.1-1ubuntu1~octave1~precise1 (using .../octave-common_3.6.1-1ubuntu1ppa1~precise1_all.deb) ...
Unpacking replacement octave-common ...
Processing triggers for menu ...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for gnome-menus ...
(Reading database ... 369976 files and directories currently installed.)
Removing liboctave2 ...
Removing pulseaudio-utils ...
Removing libpulsedsp ...
Removing rtkit ...
Removing units ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for man-db ...
Processing triggers for install-info ...
Processing triggers for menu ...
Setting up liboctave1 (3.6.1-1ubuntu1ppa1~precise1) ...
Setting up octave-common (3.6.1-1ubuntu1ppa1~precise1) ...
Installing new version of config file /etc/octave.conf ...
Setting up octave (3.6.1-1ubuntu1ppa1~precise1) ...
octave: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
dpkg: error processing octave (--configure):
 subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
                                                              Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for menu ...
Errors were encountered while processing:
 octave
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up octave (3.6.1-1ubuntu1ppa1~precise1) ...
octave: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
dpkg: error processing octave (--configure):
 subprocess installed post-installation script returned error exit status 127
Processing triggers for menu ...
Errors were encountered while processing:
 octave

Warning:  Something went wrong, packages may not have been reverted

答案1

删除添加到 /usr/local 的所有文件。如果您尚未在 /usr/local 安装任何其他软件包,请执行以下操作:

find /usr/local -type f -exec rm -f {} \;

如果您已将其他软件包安装到 /usr/local,请不要这样做。相反,您必须手动检查 /usr/local 并删除与 octave 相关的所有文件。一个好的开始是:

find /usr/local -name '*octave*' -exec rm -rf {} \;

将 libreadline 的本地构建版本移到其他地方:

mkdir ~/libreadline
mv /usr/local/lib/libreadline* ~/libreadline 

然后卸载Octave:

apt-get purge '.*octave.*'

Ubuntu 12.04 存储库中的 Octave 是 v3.2,如果想要最新的稳定版本(当前为 3.8.1),请添加 Octave 稳定版本 PPA:

add-apt-repository ppa:octave/stable

确保您的其他软件包都是最新的:

apt-get update
apt-get dist-upgrade

并重新安装八度:

apt-get install octave

正如 mtmiller 所评论的,存储库中的 Octave 将与 readline 配合使用。您只需修复系统并从官方存储库恢复 Octave。

相关内容