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?


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
  • Manual deletion (followed by restarting Terminal) worked; thanks! I can run a normally installed version of R now.
    – jaia
    Jul 20 '15 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.