软件安装不上,可能是网速慢!Conda/R/pip/brew等国内镜像大全拿走不谢~~

软件安装是生信分析的基础,除了掌握基本的软件安装理论外之后 (Linux - 命令运行监测和软件安装),就是去下载源码安装或使用包管理工具安装。通常操作都没问题时,软件却怎么都装不上,这一般都是网络问题。所以你需要一个能够快速访问的镜像,下载快还不容易断。

国内的镜像比较全的有清华镜像 (https://mirrors.tuna.tsinghua.edu.cn)和阿里云镜像 (https://developer.aliyun.com/mirror/)。下面以清华镜像为例 (阿里云镜像没有conda),展示下其操作。

Conda镜像

Conda增加清华的镜像,运行下面的代码 (后添加的通道优先级更高)

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

或直接把下面文字拷贝到 ~/.condarc中 (越靠前的优先级越高)

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

Python包管理工具 pip镜像

可以每次安装时加-i参数 (或使用alias命令)。

注意,simple不能少,  是https而不是 http

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

升级 pip 到最新的版本 (>=10.0.0) 后进行永久配置:

pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

R包安装镜像

CRAN和Bioconductor的镜像

安装前现运行这几句话,或把这几句话放在~/.Rprofile~/.Profile.site文件下 (Windows里面的路径是C:\Program Files\R\R-3.6.1\etc)。

local({r <- getOption("repos")
r["CRAN"] <- "http://mirrors.tuna.tsinghua.edu.cn/CRAN/"
options(repos=r)})

options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")

自动安装包

# 安装BiocManager
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")

# 获取已安装包
a = rownames(installed.packages())

install_package <- c("RColorBrewer", "gplots", "agricolae","optparse")

# 判断包是否存在,不存在则安装
for (i in install_package) {
  if (!i %in% a)
    BiocManager::install(i, update = F)
}

如果是Github的包安装起来比较慢,可以考虑在码云(https://gitee.com/)注册个账户,把`Github`的库先克隆到码云 (点击几下就可以实现,码云的服务器访问Github还是很快的),然后再下载到本地安装即可。

HomeBrew

Mac下默认的不少Linux命令如awk, sedcat等与Linux下使用方式有些差别,通常需要安装GNU系列的对应命令来统一代码操作。可以通过brew安装,但brew update过程默认是极其的慢,也需要改一下镜像。

安装Brew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

配置镜像

# brew 程序本身,Homebrew/Linuxbrew 相同
git -C "$(brew --repo)"  remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

# 索引的镜像
# 以下针对 mac OS 系统上的 Homebrew
git -C "$(brew --repo homebrew/core)"  remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)"  remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
git -C "$(brew --repo homebrew/cask-fonts)"  remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)"  remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git

# 更换后测试工作是否正常
brew update

# 软件包的镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

安装相应的gnu系列工具

#brew install bash
brew install coreutils

brew install gawk
brew install gnu-sed

其它镜像

还有其它镜像,如Perl的CPAN,Linux操作系统安装包,Linux操作系统自带包管理工具(yum/apt)的源,Docker镜像等。

软件安装参考

猜你喜欢

10000+:菌群分析 宝宝与猫狗 梅毒狂想曲 提DNA发Nature Cell专刊 肠道指挥大脑

系列教程:微生物组入门 Biostar 微生物组  宏基因组

专业技能:学术图表 高分文章 生信宝典 不可或缺的人

一文读懂:宏基因组 寄生虫益处 进化树

必备技能:提问 搜索  Endnote

文献阅读 热心肠 SemanticScholar Geenmedical

扩增子分析:图表解读 分析流程 统计绘图

16S功能预测   PICRUSt  FAPROTAX  Bugbase Tax4Fun

在线工具:16S预测培养基 生信绘图

科研经验:云笔记  云协作 公众号

编程模板: Shell  R Perl

生物科普:  肠道细菌 人体上的生命 生命大跃进  细胞暗战 人体奥秘  

写在后面

为鼓励读者交流、快速解决科研困难,我们建立了“宏基因组”专业讨论群,目前己有国内外5000+ 一线科研人员加入。参与讨论,获得专业解答,欢迎分享此文至朋友圈,并扫码加主编好友带你入群,务必备注“姓名-单位-研究方向-职称/年级”。PI请明示身份,另有海内外微生物相关PI群供大佬合作交流。技术问题寻求帮助,首先阅读《如何优雅的提问》学习解决问题思路,仍未解决群内讨论,问题不私聊,帮助同行。

学习16S扩增子、宏基因组科研思路和分析实战,关注“宏基因组”

点击阅读原文,跳转最新文章目录阅读

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值