5

I have an old installation of R that I would like to get rid of and replace with a new version. However, apt doesn't see this package at all. It doesn't show up in Synaptic and running sudo apt-get remove r-base gives the message "Package 'r-base' is not installed, so not removed". However, the program works and which R shows /usr/local/bin/R. (As far as I remember, I originally installed this with Synaptic, but it was a few years ago, so I could be wrong.) If I just install the new version of R via Synaptic, running R from the command line still gives me the old version. How do I either get rid of the old version or make my system use a newly installed one?

1 Answer 1

6

The binary R is usually placed in /usr/bin/R and not in /usr/local/bin/R. Therefore you haven't installed the package via a package manager from the standard repositories.

/usr/bin/R is part of the package r-base-core, therefore try this:

sudo apt-get remove r-base-core

Additionally check the subfolders in /usr/local for more R-stuff to remove, E.G.:

sudo rm /usr/local/bin/R

A full list of the possibilities:

dpkg --listfiles r-base | sed 's/usr\//usr\/local\//'
dpkg --listfiles r-base-core | sed 's/usr\//usr\/local\//'

To use the R from your configured repositories:

sudo apt-get install r-base
1
  • Manual deletion (followed by restarting Terminal) worked; thanks! I can run a normally installed version of R now.
    – jaia
    Jul 20, 2015 at 7:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .