installation path not writable R, unable to update packages

前端 未结 11 1803
轻奢々
轻奢々 2020-12-15 04:10

I am trying to install Bioconductor into R, using the code on their website. When I type in the code (see bellow) I get an error message saying that some packages can\'t be

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 04:51

    One solution is to open a terminal and load R using admin rights

    sudo R
    update.packages()
    source("https://bioconductor.org/biocLite.R")
    biocLite()
    

    Then you can update. But careful. This can create packages by the admin in a directory supposed to be owned by a user.

    In this case, instead of loading R as root (which is solving the problem until the next update), check the .libPaths(). You will have a list of directories.

    .libPaths()
    "/home/it_s_me/R/x86_64-pc-linux-gnu-library/3.4" "/usr/lib/R/library"
    

    In my case, all packages in "/usr/lib/R/library" are owned by root, and all except one are owned by a normal user (not root) at "/home/itsame/R/x86_64-pc-linux-gnu-library/3.4".

    If you have admin rights, an easy solution may be to run chown in all the places: For example, I had trouble updating the curl package. I used:

    sudo chown -R it_s_me /home/it_s_me/R/x86_64-pc-linux-gnu-library/3.4/curl/
    

提交回复
热议问题