3

I am trying to update R in my Ubuntu Xenial machine.

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

I have been checking a lot of post about how to do it. My main steps have been:

Open the source list and add the link

sudo nano /etc/apt/sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/

(Maybe I am adding the link in the wrong place of the source.list? I don't know, I am new in Ubuntu). After adding the link, I save and exit the source.list. Then my steps have been:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base

Once the process is finished, I run again:

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

I don't have a lot of experience with Linux yet but based on previous post and their solutions I cannot manage to solve the problem.

By the way, I need to update R since some of the packages I need to use (such as rgdal) are not available under the version I currently have.


$ apt-cache policy r-base
r-base:
Installed: 3.2.3-4
Candidate: 3.2.3-4
  Version table:
 *** 3.2.3-4 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:53
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:53

$ type -a R
R is /usr/bin/R

$ sudo apt-get update
Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:53
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:53
6
  • Add the output of apt-cache policy r-base and type -a R, please.
    – muru
    Oct 12, 2017 at 8:25
  • 1
    Looks like the CRAN repository is not being used for some reason. Add the output of sudo apt-get update as well, please.
    – muru
    Oct 12, 2017 at 8:36
  • question edited again
    – GCGM
    Oct 12, 2017 at 8:39
  • To close voters: Please don't close a question as a duplicate of another based on only warnings when there are actual error messages that block what OP intends to do. Feb 27, 2018 at 6:11
  • 1
    The apparent ultimate problem seems to be an already running apt process.
    – guntbert
    Feb 28, 2018 at 11:02

0

Browse other questions tagged or ask your own question.