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 8016351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:31:02+00:00 2026-06-04T20:31:02+00:00

Suppose I need to install a number of packages on a (Linux) machine that

  • 0

Suppose I need to install a number of packages on a (Linux) machine that does not have an internet connection. Let’s say that I downloaded a copy of cran and burned it on a DVD that I bring to the offline location:

wget ftp://cran.r-project.org/pub/R/src/contrib/*.tar.gz

I can even add a PACKAGES file that contains an overview of all the source packages and their dependencies:

library(tools)
write_PACKAGES()

How could I use this offline to install a source package in such a way that dependencies are resolved and installed from the local files as well? For example, someone wants to install package ggplot2, which has a fairly deep dependency structure. Assume the source package of ggplot2 and all of its dependencies are available as source packages in the current working directory. If I do:

install.packages("ggplot2_0.9.1.tar.gz", repos=NULL)

This results in an error, because the dependencies are not resolved at all. Alternatively:

install.packages(list.files(pattern="*.tar.gz"), repos=NULL)

However this also ignores the dependency structure, and tries to install packages in alphabetical order, which will also fail.

I looked into available.packages and contrib.url but I just can’t find an example of installing a source package from a local file including it’s dependencies.

  • 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-06-04T20:31:04+00:00Added an answer on June 4, 2026 at 8:31 pm

    The correct answer was given by Joshua Ulrich in the comment on the question:

    The key is prefixing the argument to either repos or contriburl with file://. So in Unixy systems one could do:

    install.packages("ggplot2", contriburl="file:///path/to/packages/")
    

    This assumes that all required source packages, as well as a PACKAGES index file is available in /path/to/packages. If no PACKAGES file is present, this should be generated first using:

    library(tools)
    write_PACKAGES("/path/to/packages/")
    

    which will generate an index of all source packages found in this directory. Note that in the example, there are 3 slashes behind the file: prefix. The third slash indicates a path relative to the root of the file system.

    The difference between the repos and contriburl argument is that repos will append another /src/contrib to the path specified, as this is usually where source packages are located on an official CRAN repository mirror.

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

Sidebar

Related Questions

I need to install a python module in the site packages that also will
Suppose we need to check three boolean conditions to perform a select query. Let
Suppose in your web application you need to do a number of redis calls
Suppose I have a CSV file with 1M email addresses. I need to iterate
Suppose I have an array of nodes (objects). I need to create a duplicate
Suppose that we have a simple c code: #include <stdio.h> #include <stdlib.h> int main(int
I have quicktime movies uploaded to my server that I need to combine together
I'm not a linux expert, and I'm trying to install a 2D graphics library
This is somewhat related to this question . Let's say I have a package
suppose i need to send mail to customer with customer detail and his order

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.