在个人开发中使用镜像,主要是为了X_X软件包、依赖项、开发工具等的下载和安装。常见的“镜像”可以分为以下几类:
一、系统级镜像(用于虚拟机或云服务器)
如果你是通过虚拟机(如 VirtualBox、VMware)或云服务器进行开发,可以选择以下系统镜像源:
推荐镜像源:
- 清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn
- 阿里云镜像站:https://mirrors.aliyun.com
- 华为云镜像站:https://mirrors.huaweicloud.com
- 网易镜像站:http://mirrors.163.com
支持的系统类型:
- Ubuntu / Debian
- CentOS / Rocky Linux / AlmaLinux
- Arch Linux
- Kali Linux
- Windows Server ISO(部分镜像站提供)
✅ 推荐:优先使用清华或阿里云的镜像,速度快、更新及时。
二、编程语言/包管理器的镜像(X_X依赖安装)
1. Python(pip)
pip install some-package -i https://pypi.tuna.tsinghua.edu.cn/simple
常用国内镜像源:
- 清华:
https://pypi.tuna.tsinghua.edu.cn/simple - 阿里云:
https://mirrors.aliyun.com/pypi/simple - 豆瓣:
https://pypi.doubanio.com/simple/
配置永久镜像:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
2. Node.js / npm
npm install some-package --registry=https://registry.npmmirror.com
常用镜像:
- 淘宝 NPM 镜像(推荐):https://registry.npmmirror.com
- 清华 TUNA:https://mirrors.tuna.tsinghua.edu.cn/npm/
设置默认:
npm config set registry https://registry.npmmirror.com
3. Go Modules
go env -w GOPROXY=https://goproxy.cn,direct
可用镜像:
https://goproxy.cn(七牛云)https://goproxy.iohttps://athens.azurefd.net(微软 Athens)
4. RubyGems
gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/
5. Rust (cargo)
你可以使用 rsproxy 或者清华源来X_X:
设置方法:
# 使用 rsproxy(推荐)
echo 'export CARGO_NET_GIT_FETCH_WITH_CLI=true' >> ~/.bashrc
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rscargo.sh | sh
三、Docker 镜像X_X器(用于 Docker 开发)
Docker Hub 下载慢?可以用下面的X_X器:
推荐方式:
1. 使用 DaoCloud X_X器(注册即可获取专属地址)
https://www.daocloud.io/mirror#accelerator-doc
2. 使用阿里云X_X器(需要阿里云账号)
进入阿里云控制台 -> 容器镜像服务 -> 镜像X_X器
3. 修改 Docker 配置文件 /etc/docker/daemon.json
示例:
{
"registry-mirrors": ["https://<your-accelerator>.mirror.aliyuncs.com"]
}
然后重启 Docker:
sudo systemctl daemon-reload
sudo systemctl restart docker
四、其他常见镜像资源
| 工具/平台 | 推荐镜像源 |
|---|---|
| Maven | 阿里云:https://maven.aliyun.com/repository/public |
| Gradle | 可以使用阿里云或清华镜像仓库 |
| Anaconda | Tsinghua: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ |
| Visual Studio Code插件市场 | 可用X_X或换源工具 |
总结:个人开发建议使用的镜像
| 类型 | 推荐镜像源 |
|---|---|
| 系统 ISO / 包 | 清华、阿里云 |
| Python pip | 清华、阿里云 |
| Node.js / npm | 淘宝 NPM 镜像 |
| Go Modules | goproxy.cn |
| Docker | 阿里云、DaoCloud |
| Rust cargo | rsproxy.cn |
如果你告诉我你具体在做什么项目(比如前端、Python、Go、AI、嵌入式等),我可以给你更具体的镜像建议。欢迎补充!
CLOUD技术博