rJava update fails in Ubuntu 20.04 LT desktop

I just tried to update rJava on my Ubuntu 20.04 LT desktop. The update went fine until the following error was reported and the update failed:

/usr/bin/ld: cannot find -lbz2
collect2: error: ld returned 1 exit status
make[2]: Leaving directory '/tmp/RtmpqjzJ1F/R.INSTALL1dd52f0e3563/rJava/jri/src'
make[2]: *** [Makefile.all:35: libjri.so] Error 1
make[1]: *** [Makefile.all:19: src/JRI.jar] Error 2
make[1]: Leaving directory '/tmp/RtmpqjzJ1F/R.INSTALL1dd52f0e3563/rJava/jri'
make: *** [Makevars:14: jri] Error 2
ERROR: compilation failed for package ‘rJava’

This error message is not very informative.
javac 11.0.11 is installed (the default version for Ubuntu 20.04 LT
Running R 4.1.1 and RStudio Version 1.4.1717

Thanks in advance for any suggestions on how to correct this problem.
Larry Hunsicker

Try installing these system libraries

sudo apt install libbz2 libbz2-dev

I tried that with the following response:

larry@larry-VirtualBox:~$ sudo apt install libbz2 libbz2-dev
[sudo] password for larry:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libbz2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
bzip2 bzip2:i386

E: Package 'libbz2' has no installation candidate
larry@larry-VirtualBox:~$ sudo apt install bzip2
Reading package lists... Done
Building dependency tree
Reading state information... Done
bzip2 is already the newest version (1.0.8-2).
bzip2 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

To be sure that I was lacking a "-dev" library, I tried the following and got the following response:
larry@larry-VirtualBox:~$ sudo apt install bzip2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package bzip2-dev

So that doesn't seem to have been the problem. But many thanks for the suggestion!
Larry Hunsicker

That is weird I can install libbz2-dev on Ubuntu 20.04 LTS and compile rJava without issues, maybe you are missing some package repository.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.