Can't install R on Ubuntu 16.04

So when I try to run the code to install R

rPkgsInstall -pkgs ALL

I get the following error

oo Warning:
Failed to load R_io.so with this error message:

Error in dyn.load(ll) :
unable to load shared object ‘/home/nheugel/abin/R_io.so’:
libXp.so.6: cannot open shared object file: No such file or directory
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted

Poking around seems to indicate that libXp doesn’t exist on 16.04 anymore.

running afni_system_check.py -check_all

-------------------------------- general ---------------------------------
architecture: 64bit ELF
system: Linux
release: 4.4.0-66-generic
version: #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017
distribution: Ubuntu 16.04 xenial
number of CPUs: 64
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/nheugel/abin/afni
afni version : afni: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
:
AFNI_version.txt : AFNI_17.0.17, linux_openmp_64, Mar 27 2017
which python : /usr/bin/python
python version : 2.7.12
which R : /usr/bin/R
R version : R version 3.3.3 (2017-03-06) – “Another Canoe”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/home/nheugel/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python2.7)
python2 : 1 (/usr/bin/python2.7)
python3 : 1 (/usr/bin/python3.5)

testing ability to start various programs…
afni : FAILURE
afni: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
suma : FAILURE
suma: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
3dSkullStrip : FAILURE
3dSkullStrip: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
uber_subject.py : success
3dAllineate : FAILURE
3dAllineate: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
3dRSFC : FAILURE
3dRSFC: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
SurfMesh : FAILURE
SurfMesh: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE
Error in dyn.load(ll) :
unable to load shared object ‘/home/nheugel/abin/R_io.so’:
libXp.so.6: cannot open shared object file: No such file or directory
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted

checking for $HOME files…
.afnirc : found
.sumarc : missing
.afni/help/all_progs.COMP : missing

------------------------------ python libs -------------------------------
++ module ‘PyQt4’ found at /usr/lib/python2.7/dist-packages/PyQt4
++ module loaded: PyQt4

-------------------------------- env vars --------------------------------
PATH = /bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/nheugel/abin

PYTHONPATH =
R_LIBS = /home/nheugel/R

LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /home/nheugel/abin

------------------------------ OS specific -------------------------------
which yum : /usr/bin/yum
yum version : 3.4.3
which apt-get : /usr/bin/apt-get
apt-get version : apt 1.2.19 (amd64)

have Ubuntu system: Ubuntu 16.04 xenial

========================= summary, please fix: =========================

  • AFNI programs show FAILURE
  • missing R packages (see rPkgsInstall)
  • consider running “suma -update_env” for .sumarc
  • consider running: apsearch -update_all_afni_help
  • insufficient data for AFNI bootcamp

seems to confirm that the issue seems to be the R library. I have found ways to download and install R without libXp, but I don’t know how to interface that with ANFI so I can run the program. Any help would be appreciated

Hi-

Yes, we need to update the build instructions for the newest LTS Ubuntu 16.04.

  1. To install libXp, start by opening /etc/apt/sources.list (which probably requires opening the file with ‘sudo’), add the following line:

deb http://security.ubuntu.com/ubuntu precise-security main

… then install via:


sudo apt update
sudo apt install libxp6

  1. Other things to install:

sudo apt-get install -y libglu1-mesa-dev
sudo apt-get install libxm4

  1. Installing GSL:

sudo apt-get install -y libgsl0-dev
sudo apt-get install -y gsl-bin

  1. Setting up link for GSL. Check the output of:

find /usr/lib -name "libgsl*"

… If one of the things that shows up is:


/usr/lib/x86_64-linux-gnu/libgsl.so

Then you can enter the following:


sudo ln -s /usr/lib/x86_64-linux-gnu/libgsl.so /usr/lib/libgsl.so.0

And then you can run the system check again.

Let us know how it goes.

–pt

This is what I get when I follow those steps ad try to run


sudo apt install libxp6

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libxp6 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

E: Package ‘libxp6’ has no installation candidate

The previous steps all seemed to work, but it’s the same issue I had encountered trying to install libxp6 on my own. Do you know how to deal with this issue?

Hi-

There was a little bit of bad formatting in the previous post, as the URL got converted into a link, so directly copy/pasteing wouldn’t work…

Just to make sure that this isn’t the issue, could we retry Step #1 again, with copy/pasting this line:
deb http://security.ubuntu.com/ubuntu/ precise-security main

… into “/etc/apt/sources.list” (again, probably you need to type “sudo” in the command to open it up in an editor), and then run these:


sudo apt update
sudo apt install libxp6

… and see what that does for your afni_system_check.py, and/or checking the aptitude install list with:


apt list --installed | grep libxp6

Thanks,
pt

That worked. Thanks for your help!

I had caught the missing http:// but not the /ubuntu

Acutally I could not install “libxp6” either, does anyone remember how to fix this?


sudo apt install libxp6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libxp6

Before this, I am trying to install R package with " rPkgsInstall -pkgs ALL" but could not find the R_io.so file either.


 rPkgsInstall -pkgs ALL

oo Warning: 
   Failed to load R_io.so with this error message:

Error in dyn.load(ll) : 
  unable to load shared object '/home/yerong/abin/R_io.so':
  libXp.so.6: cannot open shared object file: No such file or directory
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
Execution halted

There should be no reason to install libxp or libxp6 under ubuntu.

The initial message was trying to run the linux_openmp_64 package
under ubuntu, which is no longer necessary. If that is what you are
doing too, please instead install the ubuntu16 package:

@update.afni.binaries -package linux_ubuntu_16_64

  • rick

Hi.
Is there a convenient shell script that allows you to install everything at once? I need for Ubuntu 16.04 Xenial?
best torque wrench

Hi-

Well, there is this pretty convenient page of commands to copy+paste:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_linux_ubuntu16.html

There is a brief “Purpose” of what each is doing on your computer, so you can see what is being done by each. (Of course, those are ignorable, as well.) The system check command at the end will inform you of any problems/difficulties.

And the Message Board is always here to help…

–pt