Friday, July 25, 2014

Uninstalling old version of R in Ubuntu 12.04.4 for R 3.1.1

After many frustrated attempts at installing the newer version of R aka R version 3.1.1 (2014-07-10) I finally figured out what was perhaps happening.

I had done the glorious and famous step 0 of:
sudo apt-get update
sudo apt-get remove r-base
sudo apt-get remove r-base-core

up to no avail! R.2 something always managed to run and execute itself.

"Sock it to Me"

What finally worked was an interesting combinations of various suggestions on internet that some how worked together - like a miracle!

The long and short of the procedure of installing R. 3.1.1  after successfully effacing the older version of R is:

Uninstalling the older version
Step 1: Do the Step 0 (the above mentioned glorious and famous step 0) of removing r-base and r-base-core

Step2: See what still remains:
 dpkg --get-selections | grep "^r\-"'

Step 3: Individually purge the files that belong to 'r-' family. I used sudo apt-get purge (name of R related file)

Installing the R 3.1.1 (2014-07-10) -- "Sock it to Me" 
Step 4: Followed suggestions as mentioned here: (http://askubuntu.com/a/352438) Please note that when I typed in the command for seeing r packages
apt-cache showpkg r-base I saw different packages than the ones mentioned in the comments. This is explainable as packages keep updating with newer ones showing up. I had the following show up:

Package: r-base
Versions:
3.1.1-1precise0 (/var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_precise_Packages) (/var/lib/dpkg/status)
 Description Language:
                 File: /var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_precise_Packages
                  MD5: 5787ca79ed716232c4cc2087ed9b425b

so I did
sudo apt-get install -f r-base=3.1.1-1precise0

Step 5: Typed in R and bingo!!

Enjoy R folks!