话说 macports 到底怎么用镜像加速?

143 天前
 ab
修改: /opt/local/etc/macports/sources.conf
rsync://pek.cn.rsync.macports.org/macports/release/tarballs/ports.tar [default]

修改: /opt/local/etc/macports/macports.conf
rsync_server pek.cn.rsync.macports.org
rsync_dir macports/release/tarballs/base.tar

在 /opt/local/etc/macports/archive_sites.conf 添加:
name macports_archives
urls https://mirrors.tuna.tsinghua.edu.cn/macports/packages/
type tbz2

已经做了上面三处的的配置了,依旧从官方源拉取的包?

ab@localhost ~ % sudo port install p7zip
Password:
---> Fetching archive for p7zip
---> Attempting to fetch p7zip-16.02_5.darwin_20.x86_64.tbz2 from https://packages.macports.org/p7zip
---> Attempting to fetch p7zip-16.02_5.darwin_20.x86_64.tbz2.rmd160 from https://packages.macports.org/p7zip
---> Installing p7zip @16.02_5
---> Activating p7zip @16.02_5
1187 次点击
所在节点    macOS
6 条回复
alvinbone88
143 天前
设置一下 macports.conf 里的 preferred_hosts
ab
143 天前
@alvinbone88 以下设置未起作用
preferred_hosts mirrors.tuna.tsinghua.edu.cn
alvinbone88
143 天前
呃……我设置的是 preferred_hosts *.cn.*.macports.org
alvinbone88
143 天前
ab
143 天前
@alvinbone88 搞定完成,V 站总是有高手。
Kobayashi
140 天前
macports.conf 中 rsync_server 设置的是 base ( port 命令主体) 的镜像。

sources.conf 设置 ports 文件(软件如何打包的定义文件 Portfile ) 镜像。

archive_sites.conf 对应的是一个软件编译后的预编译文件,类似 Homebrew bottle 。

macports.confg 中 preferred_hosts 不是很确定是否影响上边全部,但肯定会影响 distfiles 获取,从源码编译软件时去哪里拉取源码。( MacPorts 不直接使用 github 等仓库中软件的源码,自己的 distfiles 优先。)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1002670

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX