更新了 Ubuntu 并重新安装了 R,现在如果我尝试在终端上运行 R,我会得到以下错误,我得到了问题所在
/usr/local/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
我尝试了一些线程仍然无法解决
Ubuntu 18.04 中的 libreadline.so.6 问题
$ which R
/usr/local/bin/R
$ R --version
/usr/local/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
$ dpkg -l "libreadline*"
dpkg-query: no packages found matching .
dpkg-query: no packages found matching –
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================-============-============-======================================================
un libreadline-common <none> <none> (no description available)
ii libreadline-dev:amd64 8.0-4 amd64 GNU readline and history libraries, development files
un libreadline-gplv2-dev <none> <none> (no description available)
un libreadline4 <none> <none> (no description available)
un libreadline5 <none> <none> (no description available)
un libreadline5-dev <none> <none> (no description available)
un libreadline6-dev <none> <none> (no description available)
ii libreadline8:amd64 8.0-4 amd64 GNU readline and history libraries, run-time libraries
答案1
为了获得更可重复的结果,我建议删除本地安装的 R
sudo rm /usr/local/bin/R
然后从官方存储库安装版本
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install r-base-dev
然后通过运行来测试安装R --version
。