7

I upgraded from Ubuntu 16.04 to Ubuntu 18.04 and cannot get R to run on it. I get the following error:

/usr/local/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

This issue seems to have come up before in similar situations:

I tried purging the library and R and then reinstalling them, with no luck.

This is not a duplicate of how to install R on ubuntu 16.04. I could install R, but could not run it. I had also installed R on previous ubuntu versions without problems.

One thing that might help: I have no problem running R on another computer where I installed ubuntu 18.04; the problem occurs on the computer where I upgraded from 16.04 to 18.04, so something about the upgrading process might be the issue.

5 Answers5

14

I also came across this issue after upgrading to Ubuntu 18.04, and after spending some time looking into the issue I found that after upgrade libreadline package was missing, so I installed libreadline package using

sudo apt-get install libreadline-dev

But this also didn't solve my problem. Then I figured out that it installed the upgraded version of the libreadline package i.e libreadline.so.7.0. As a workaround I created its symlink so I can continue my work with libreadline.so.6.

$ cd /lib/x86_64-linux-gnu/
$ sudo ln -s libreadline.so.7.0 libreadline.so.6

And this worked wonders and my problem with libreadline package was solved.

1

This seems to have been an issue with the upgrade. I did not clean new install of Ubuntu 18.04 and then R, and the error disappeared.

1

You would use rm, i.e.

$ rm libreadline.so.6

Then you can simply recreate the symbolic link.

Greenonline
  • 2,182
1

I had the same issue installing R in Anaconda. This is seemingly related to older versions of R. Symlinking to the newest version of libreadline created some error messages for me, so I'd thought I'd share the solution to install the "missing" version:

libreadline.so.6 is not provided by any official deb-packages in the Ubuntu repository, only Debian Jessie has package for it. If you want to save Anaconda - install this library manually by using commands below

cd ~/Downloads
wget -c wget
http://ftp.debian.org/debian/pool/main/r/readline6/libreadline6_6.3-8+b3_amd64.deb
wget -c
http://ftp.debian.org/debian/pool/main/g/glibc/multiarch-support_2.19-18+deb8u10_amd64.deb
sudo apt install ./libreadline6_6.3-8+b3_amd64.deb 
./multiarch-support_2.19-18+deb8u10_amd64.deb ```
Pål Bjartan
  • 637
  • 3
  • 10
  • 26
0

This error is due to miss-match installation. Please check operating system version and install correct application version.