Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I need to install R 3.0.2 because a needed library isn't compatible with 3.0.3 yet (the latest).

I can install the older version of R like so:

sudo apt-get install r-base=3.0.2-1precise0

However all the dependencies of r-base try and install with 3.0.3

root@foo:~# apt-get install r-base=3.0.2-1precise0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base : Depends: r-recommended (= 3.0.2-1precise0) but 3.0.3-1precise0 is to be installed
E: Unable to correct problems, you have held broken packages.

How can I install r-base 3.0.2 and all the dependencies as 3.0.2 ?

share|improve this question

marked as duplicate by bain, Luis Alvarado Jul 24 '14 at 23:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Did you try apt-get install r-base=3.0.2-1precise0 r-recommended=3.0.2-1precise0? – Danatela Mar 17 '14 at 4:03
  • First remove the packages

    sudo apt-get remove r-base
  • A bit of cleaning

    sudo apt-get clean; sudo apt-get autoclean
  • Reinstall R forcing an older version

    sudo apt-get install r-base=3.0.2-1precise0
share|improve this answer
Thanks for the suggestion. I tried it, but it looks like 3.0.3 is still installed. Could this be a problem with the package? Full output here: – spuder Mar 17 '14 at 4:27
Have you tried sudo apt-get autoremove.Try it and again install R – Registered User Mar 17 '14 at 4:38
did you want this 3.0.2-1precise? – Avinash Raj Mar 17 '14 at 4:39

You can downgrade packages by simply installing over the top. apt is smart enough to handle this properly.

To install R 3.0.2 I ran dpkg -S /usr/bin/R and found that the binary was provided by r-base-core. Downgrading that fixed the issue

apt-get install r-base-core=3.0.2-1precise0  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  r-cran-foreign ...
Use 'apt-get autoremove' to remove them.
Suggested packages:
  ess r-doc-info r-doc-pdf r-mathlib
The following packages will be REMOVED:
  r-base r-cran-class r-cran-cluster r-cran-kernsmooth r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-recommended
The following packages will be DOWNGRADED:
0 upgraded, 0 newly installed, 1 downgraded, 9 to remove and 123 not upgraded.
Need to get 21.5 MB of archives.

apt-get install r-base=3.0.2-1precise0
apt-get install r-recommended=3.0.2-1precise0
share|improve this answer

Disable "Universe" repository from software and updates and then run the below commands on terminal,

sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update 
sudo apt-get install r-base
share|improve this answer
When he will re enable universe repo and then try updating or upgrading, won't he have some (dependency) problem again? – Registered User Mar 17 '14 at 4:48
Once installed, after that he won't get any dependency errors. – Avinash Raj Mar 17 '14 at 4:49
see this link, marutter PPA contains the specified r-base package version. – Avinash Raj Mar 17 '14 at 4:52

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