Files
omarchycn/manual/zh-cn/02-mirrors.md
T

38 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 镜像管理
## pacman 镜像
```bash
omarchycn mirror benchmark # 测速:延迟、吞吐、同步新鲜度
omarchycn mirror apply china # 自动选最优中国镜像(1 主 + 2 备)
omarchycn mirror apply official # 回到官方全球源
omarchycn mirror pin tuna # 固定单一镜像
omarchycn mirror status # 当前策略与镜像列表
omarchycn mirror restore # 恢复最近一次备份
```
每次写入 `/etc/pacman.d/mirrorlist` 前自动生成带时间戳备份。候选列表在 `cn/mirrors.json`
主镜像失效时:
```bash
omarchycn doctor mirror --fix # 检测并自动切换到健康镜像
```
## 开发工具镜像
覆盖 npm、pip、cargo、go、gem、docker 六个生态:
```bash
omarchycn dev-mirror list # 当前各生态源
omarchycn dev-mirror apply china # 全部切国内
omarchycn dev-mirror apply official --target npm # 指定生态切官方
omarchycn dev-mirror set npm https://my.registry/ # 自定义
omarchycn dev-mirror doctor # 连通性检查
```
写入前备份到 `~/.local/state/omarchycn/backups/dev-mirror/<时间戳>/`
恢复:`omarchycn restore list` + `omarchycn restore config <时间戳>`(仅用户级文件)。
docker 目标写 `/etc/docker/daemon.json`(需 sudo,重启 docker 生效;系统文件不参与
自动恢复,回退用 `omarchycn dev-mirror apply official --target docker`)。