4
votes

I am currently using Ubuntu 12.04 64 bit .I was trying to install R as specified on this link . I am successfully able to install r-base but getting errors when trying to install r-base-dev . Here is the error

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-dev : Depends: gfortran but it is not installable
              Depends: libblas-dev but it is not installable or
                       libatlas-base-dev but it is not going to be installed
              Depends: liblapack-dev but it is not installable or
                       libatlas-base-dev but it is not going to be installed
              Depends: libreadline-dev but it is not installable
              Depends: libjpeg-dev but it is not installable
              Depends: libpcre3-dev but it is not installable
              Depends: libpng-dev but it is not installable
              Depends: libbz2-dev but it is not installable
              Depends: cdbs but it is not installable
E: Unable to correct problems, you have held broken packages.

I have added the security key as stated in that link as well as the following line deb http://cran.r-project.org/bin/linux/ubuntu precise/ to /etc/apt/sources.list

I have also added the following ppa : sudo add-apt-repository ppa:marutter/rrutter .

Any help would be appreciable.

PS: I was also doubtful with my lists in /var/lib/apt/lists so I deleted and created it again. Still having the same error .

1
Do you have all those packages it says are unmet dependencies? You need those -dev packages to be able to compile the fortran and c code in the -dev package of R.Justin
No i do not have those packages. I searched for them but I am not able to install those packages those. Error it showing is : Package gfortran is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source Ankit Kulkarni
I have also searched via synaptic package manager which broken packages i have but no broken packages are listed in that too.Ankit Kulkarni
Try to install each one separately. sudo aptitude search first. you might have to update the names accordingly. gfortran for instance should install via: sudo apt-get install gfortran-4.6.Justin
Thanks for help but I have tried doing so and still I am getting the same error .I installed gfortran 4.8 and other such but the error is still the same .Ankit Kulkarni

1 Answers

2
votes

I made sure that the restricted and universe repositories are enabled (which was disabled in case of mine ). For doing this , Hit Alt + F2 type software-properties-gtk and hit Enter.

Under Ubuntu Software tab enable all the repositories. enter image description here After which run

sudo apt-get update

Again run

sudo apt-get install r-base-dev

And done successfully.

I got the above solution from this link