Question: R Update on Linux
0
gravatar for oars
16 months ago by
oars160
oars160 wrote:

I'm trying to get my Linux environment updated with the latest R packages which is proving to be quite difficult. The R version on my Linux machine is 3.2.3 (Wooden Christmas-Tree), and despite 2-days of troubleshooting I still cannot get the update commands to execute. An updated version of R is required before the bioconductor suite can download (“A new version of Bioconductor is available after installing the most recent version of R; see http://bioconductor.org/install”).

Typically, two simple commands will update R in Linux:

sudo apt-get update

Followed by:

sudo apt-get install r-base

However, I cannot get the sudo apt-get update to work, I keep getting the following error message:

E: Could not get lock /var/lib/apt/lists/lock - open (11:Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

From what I’ve read on the web, to fix the problem, you must remove the lock files using the commands below:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

After that, reconfigure the packages:

sudo dpkg --configure -a

But it doesn't work!?! Anyone else using Linux ever experience a similar error message?

linux bioconductor R • 1.4k views
ADD COMMENTlink modified 16 months ago • written 16 months ago by oars160
1

But it doesn't work!?

Since you have sudo privileges it is unclear why that is not working. Are you using both a GUI and a terminal window to try and update these packages?

ADD REPLYlink modified 16 months ago • written 16 months ago by genomax75k
1
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

But it doesn't work!?!

I suppose you mean that, even after trying the above solution, you get the same error:

E: Could not get lock /var/lib/apt/lists/lock - open (11:Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

What is your operating system, and its version?

ADD REPLYlink written 16 months ago by h.mon28k

Alpha OS 1.0.0 Polaris, Built on "Ubuntu 16.04.3 LTS", Linux 4.13.0-45-generic.

ADD REPLYlink written 16 months ago by oars160
1

I have found two Alpha OSes, one based on Arch Linux and another on Puppy Linux. I guess your Alpha OS is the Puppy Linux one, as Puppy is based on Ubuntu. Did you install it onto the hard-drive, or are you running from a pen-drive?

Anyway, my suggestion is to install one of the major Linux distributions, which have large user bases, both inside and outside the bioinformatics community.

ADD REPLYlink written 16 months ago by h.mon28k
1

see if aptitude, synaptic or update manager are running. Type ps aux| grep apt see if apt is running in the background.

ADD REPLYlink modified 16 months ago by RamRS25k • written 16 months ago by cpad011212k

I was able to update R using conda:

$ conda install -c r r=3.4.2

But when I launch a new R session, I keep seeing the older version...

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"

Do I need to restart my system? Something seems wrong.

ADD REPLYlink written 16 months ago by oars160
1

Older version of R must be in your $PATH. You could either remove old R or append path to new R before your current path by doing export PATH=/path_to_new_R/$PATH.

ADD REPLYlink written 16 months ago by genomax75k
1

You either need to add the newly installed R to your $PATH, or create a named conda environment and activate it:

conda create -n myrenv r=3.4.1
source activate myrenv
which R
ADD REPLYlink written 16 months ago by RamRS25k

This ^ was a winner! I'm now running 3.5.0 and was able to FINALLY install the Bioconductor suite. Thanks to all!

Seriously, thank you!

ADD REPLYlink written 16 months ago by oars160
1

I moved @Ram's original comment (which has all the information needed) to an answer. You can accept that to provide closure to this thread.

ADD REPLYlink written 16 months ago by genomax75k
4
gravatar for RamRS
16 months ago by
RamRS25k
Houston, TX
RamRS25k wrote:

In my experience, it helps to use conda (as opposed to apt-get) to manage software where software version makes a significant difference. I use it for R and python. For example, I have environments with r=3.4.1 and r=3.3.x that I activate and use at will. You might benefit from using conda as well.

Conda: https://conda.io/docs/user-guide/install/index.html

Conda create environment: https://conda.io/docs/user-guide/tasks/manage-environments.html

Conda custom R environment: https://stackoverflow.com/a/44185194/1394178

ADD COMMENTlink modified 16 months ago • written 16 months ago by RamRS25k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1866 users visited in the last hour