Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 578051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:13:10+00:00 2026-05-13T14:13:10+00:00

When installing R packages (say mcmcpack in this example) under Ubuntu I have the

  • 0

When installing R packages (say mcmcpack in this example) under Ubuntu I have the choice between the following two methods of installation:

# Let the distribution's packaging system take care of installation/upgrades
apt-get install r-cran-mcmcpack

# Let R take care of installation/upgrades
install.packages("mcmcpack")

Questions:

  • Is any of the two ways of installing R packages considered “best practice”?
  • Assume that I first install.packages("mcmcpack") and later on apt-get install r-cran-mcmcpack – should I expect trouble?
  • Assume that I first apt-get install r-cran-mcmcpack and later on install.packages("mcmcpack") – should I expect trouble?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:13:11+00:00Added an answer on May 13, 2026 at 2:13 pm

    Update (some thirteens years later): It is now as easy as it seems if you use for example the wonderful and powerful r2u system I set up last year, and which now provides over 20k binary .deb packages for each of twi Ubuntu LTS releases (currently: 20.04 and 22.04), and is also accessible via install.packages() thanks top bspm. Follow the link to r2u for more.


    It’s not as easy as it seems.

    • apt-get update is good if and when

      • packages exist — but there are only around 150 or so r-cran-* packages out of a pool of 2100+ packages on CRAN, so rather sparse coverage

      • packages are maintained, bug free and current

      • you are happy enough with the bi-annual releases by Ubuntu

    • install.packages() and later update.packages() is good if and when

      • you know what it takes to have built-time dependencies (besides r-base-dev) installed

      • you don’t mind running update.packages() by hand as well as the apt-get updates.

    On my Ubuntu machine at work, I go with the second solution. But because the first one is better if you have enough coverage, we have built cran2deb which provides 2050+ binary deb packages for amd64 and i386 — but only for Debian testing. That is what I use at home.

    As for last question of whether you ‘should you expect trouble’: No, because R_LIBS_SITE is set in /etc/R/Renvironment to be

    # edd Apr 2003  Allow local install in /usr/local, also add a directory for
    #               Debian packaged CRAN packages, and finally the default dir 
    # edd Jul 2007  Now use R_LIBS_SITE, not R_LIBS
    R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:\
    /usr/lib/R/site-library:/usr/lib/R/library'}
    

    which means that your packages go into /usr/local/lib/R/site-library whereas those managed by apt go into /usr/lib/R/site-library and (in the case of base packages) /usr/lib/R/library.

    Hope that clarifies matters. The r-sig-debian mailing list is a more informed place for questions like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a library called example that I'm installing into my global site-packages directory.
When installing rJava using the install.packages(rJava) command I get the following error: checking Java
Installing Merb on Ruby Enterprise Edition (OS X) throws this error, any ideas? sudo
When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root
After installing VMware Server I get the following error when I try to access
So, I want to start using virtualenv this year. I like the no-site-packages option,
I'm building only a limited number of packages, which have the same dependency set
https://github.com/jtauber/django-notification It doesn't say anything about installing. How do I import it? What do
I'm need to choose a software package for installing software. NSIS and WiX seem
Installing my software on Windows XP was always easy. Everything went in the c:\Program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.