Biostar Beta. Not for public use.
R Update on Linux
0
Entering edit mode
2.5 years ago
oars • 150
@oars41179

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?

R Bioconductor Linux • 945 views
1
Entering edit mode

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?

1
Entering edit mode
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?

0
Entering edit mode

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

1
Entering edit mode

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.

1
Entering edit mode

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

0
Entering edit mode

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 1 Entering edit mode 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 1 Entering edit mode 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

0
Entering edit mode

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!

1
Entering edit mode

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.

4
Entering edit mode
2.5 years ago
RamRS 21k
@RamRS

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 custom R environment: https://stackoverflow.com/a/44185194/1394178