环境:在Debian系统上安装的R&RStudio Server,系统环境为R 4.4.1、Bioconductor3.20。
通过指定.Rprofile指定的清华源:
options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
安装之后几天安了一大堆依赖环境都是正常的,就没去管它。过了将近半年(25.5.5),需要安装一个包,发现无法安装,提示:
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://mirrors.tuna.tsinghua.edu.cn/CRAN/
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/bioc/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/bioc/src/contrib/PACKAGES'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/annotation/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/annotation/src/contrib/PACKAGES'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/experiment/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/experiment/src/contrib/PACKAGES'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/workflows/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/workflows/src/contrib/PACKAGES'”
Bioconductor version 3.20 (BiocManager 1.30.25), R 4.4.1 (2024-06-14)
Warning message:
“package(s) not installed when version(s) same as or greater than current; use
`force = TRUE` to re-install: 'ncdf4'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/bioc/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/bioc/src/contrib/PACKAGES'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/annotation/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/annotation/src/contrib/PACKAGES'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/experiment/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/data/experiment/src/contrib/PACKAGES'”
Warning message:
“无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/workflows/src/contrib中读写索引:
无法打开URL'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.20/workflows/src/contrib/PACKAGES'”
检查网络都是正常的,但是这些链接通过浏览器打开也是404无法访问。
搜索得到一大堆结果都是没用的,后来在网上找到了原因:
您好,根据 Bioconductor 的安排,在 5 月 15 日,3.18 及此前版本的相关数据已经被归档,并从其同步来源中被移除。为节约镜像站磁盘空间,我们也相应移除了这些文件。该操作是不可逆的,我们无法重新找回在归档中的文件。
希望保留 Bioconductor 源的历史版本
R更换西湖大学源
原因是镜像站只保留最新版本的Bioconductor包,在安装时已经出到了3.21,对应R也是4.4.2版本,故3.20版本无法安装。
解决方式:
- 更新R&Biocmanager:
我使用的是apt安装,运行
sudo apt update r-base
即可更新R到最新版本,同时升级BiocManager即可解决。
install.packages("BiocManager")
但是服务器上依赖太多,牵一发而动全身,不想更新,则使用plan B
2:修改镜像源
由西湖大学提供的镜像源包含了从R 4.0之后的全部版本,且会一直支持:
只要设置镜像从西湖大学获取:
options("repos" = c(CRAN="https://mirrors.westlake.edu.cn/CRAN/"))
options(BioC_mirror="https://mirrors.westlake.edu.cn/bioconductor")
在R环境中输入即可生效。当然也可以在用户根目录新建一个.Rprofile文件
Windows:C:\Users\<用户名>\.Rprofile
Linux:~/.Rprofile
写入以下内容:
options("repos" = c(CRAN="https://mirrors.westlake.edu.cn/CRAN/"))
options(BioC_mirror="https://mirrors.westlake.edu.cn/bioconductor")
重启R即可安装。