Till recently, I was using R-3.1.1 on Windows OS. Then on April 16, 2015 (10 days ago), they released R-3.2.0. Upgrading it on Windows was easy peasy, not like the headache Ubuntu gave me.
I recently got a Dell Vostro 14 3000 series laptop with Ubuntu 12.04 installed. I haven’t yet upgraded to Ubuntu 14.04 because the graphics drivers for this computer aren’t available for that version. Besides, I’m not much of a gamer. If I were, I wouldn’t care for Ubuntu!
Anyway, I tried installing by typing the following on Terminal:
sudo apt-get update
sudo apt-get install r-base r-base-dev
R did get installed, but not the latest version. A much older version R-2.14.1. I later found out after quite a lot of time spent on StackExchange, that I had to choose a CRAN mirror that was geographically close to my computer, which would then act as a “software source” for the latest version of R. Now that explained why the above sudo commands weren’t getting me the desired version of software. It was because the the Ubuntu / Canonical software repositories only had an older R version. Also, the distribution line had to match the codename of my Ubuntu version (12.04 LTS).
codename=$(lsb_release -c -s)
echo "deb http://ftp.iitm.ac.in/cran/bin/linux/ubuntu $codename/" | sudo tee -a /etc/apt/sources.list > /dev/null
Note that instead of http://ftp.iitm.ac.in/cran one must replace it with the geographically closest CRAN mirror. Also, the Ubuntu archives on CRAN are signed with the key of Michael Rutter <marutter@gmail> with key ID E084DAB9. So we type in the following:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo add-apt-repository ppa:marutter/rdev
Followed by what we would normally have done:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base r-base-dev
This did the job for me, and I had R-3.2.0 installed successfully on my Ubuntu system. Compare this to Windows, where all you have to do is type in 3 lines (in R, and not Shell):
install.packages("installr") library(installr) updateR()
And to think I left Windows for Linux! I am a Linux newb, and God only knows why I wanted to try out Linux, but on giving it some thought, I think I know why
source: https://xkcd.com/456/ and http://xkcd.com/149/
Thanks for the nice little how-to.
But don’t forget one thing about the difference between windows and linux here.
You made a guide on how to install R. Not only update it. Also it is now automatically updated with your OS. In windows you still have to update it every time manually.
LikeLiked by 1 person
thanks – very helpful – never thought i’d find something more awkward on ubuntu then windows 🙂
LikeLike
Thank you!
LikeLike
I’m glad it helped!
LikeLike
[…] Source: Upgrading R / Installing R-3.2.0 on Ubuntu […]
LikeLike
linux is way better then windows once you get out of noob status. when noob, and if lazy, stick to windows and get all their crap proprietary software and backdoors.
linux forever !
LikeLike
Thanks a lot! Btw, I loved your cartoons
LikeLiked by 1 person
Having much more dev time on Windows, I found this a rather painful experience, but you saved my back. Thank you!
I did everything except:
sudo add-apt-repository ppa:marutter/rdev
and it was driving my crazy.
LikeLiked by 2 people
BTW, you are missing the “install” keyword in the second sudo at the beginning of the blog.
LikeLike
Yes. Thanks for pointing that out. Change made
LikeLike
This was really very useful and worked for me. Thanks so much!
LikeLike
Thanks so much, this worked wonders. Also, I relate to that comic a lot. Keep up the good work 🙂
LikeLike
Thanks so much! Saved a lot of time.
LikeLike
Thankyou So much, very helpful !
LikeLike
sudo add-apt-repository ppa:marutter/rdev
is really necessary?
LikeLike
I must say you have high quality content here. Your
page can go viral. You need initial traffic only.
How to get it? Search for; Etorofer’s strategies
LikeLike
Howdy I am so excited I found your website, I really found you by
mistake, while I was looking on Aol for something else, Anyways I am
here now and would just like to say cheers for a tremendous post and
a all round entertaining blog (I also love the theme/design), I
don’t have time to look over it all at the minute but I have saved it and also added your RSS feeds, so when I have time I will be back to read a lot
more, Please do keep up the excellent jo.
LikeLike
ScholarsPro is a prominent name in the online training industry, known for its world-class training and consulting solutions for internationally recognized certifications and leading technologies such as Big Data Hadoop, SAS, Python, Data Science, ITIL, PRINCE2, Scrum, PMP, and many more. With a powerful team comprising of international scholars, certified trainers, and industry experts, ScholarsPro stands strong in the training and consulting sector, assisting professionals from diverse industry domains from all over the world, fulfill their professional development endeavors.
LikeLike
Thanks a lot! Great post. What did the line end up looking like in your sources.list file? Mine is outputting as:
deb http://FOO/ubuntu trusty/
without any Ubuntu version numbers, is that correct?
LikeLike