conda 更换镜像究极方法

发布于:2025-03-03 ⋅ 阅读:(134) ⋅ 点赞:(0)

conda安装软件一直用的北外镜像,但是我租的服务器机构IP好像最近被屏蔽了,一直无法使用。机构内部搭了本地镜像。

在更换本地镜像(修改.condarc文件)后,新建环境可以正常使用本地镜像,但是之前建的环境依旧还在沿用北外镜像,无法安装软件。

问题

已经使用过如下命令清除缓存,也手动清理了本地缓存。但是显示依然沿用旧 conda 镜像

$ conda clean -i 
# 或者
$ conda clean --all

● 手动指定的镜像与搜索的镜像不一致,还是显示用默认镜像和北外镜像,其实这里北外已经是被删除了。

$ conda install  -c http://xx.xx.xx.xx:8181/cloud/bioconda r-mcpcounter
Channels:
 - defaults
 - http://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge
 - http://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda
 - bioconda
 - conda-forge
Platform: linux-64
# 这里未展示剩余错误

解决

● 添加 --override-channels选项覆盖当前现有的镜像配置。

$ conda install -c http://xx.xx.xx.xx:8181/cloud/bioconda/ r-mcpcounter --override-channels

Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

conda安装软件一直用的北外镜像,但是我租的服务器机构IP好像最近被屏蔽了,一直无法使用。机构内部搭了本地镜像。

在更换本地镜像(修改.condarc文件)后,新建环境可以正常使用本地镜像,但是之前建的环境依旧还在沿用北外镜像,无法安装软件。

问题

已经使用过如下命令清除缓存,也手动清理了本地缓存。但是显示依然沿用旧 conda 镜像

$ conda clean -i 
# 或者
$ conda clean --all

● 手动指定的镜像与搜索的镜像不一致,还是显示用默认镜像和北外镜像,其实这里北外已经是被删除了。

$ conda install  -c http://xx.xx.xx.xx:8181/cloud/bioconda r-mcpcounter
Channels:
 - defaults
 - http://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge
 - http://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda
 - bioconda
 - conda-forge
Platform: linux-64
# 这里未展示剩余错误

解决

● 添加 --override-channels选项覆盖当前现有的镜像配置。

$ conda install -c http://xx.xx.xx.xx:8181/cloud/bioconda/ r-mcpcounter --override-channels

Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

网站公告

今日签到

点亮在社区的每一天
去签到