12

使用reflector自动更改Pacman的软件源

 2 years ago
source link: https://blog.dugulingping.com/Linux/reflector.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
使用reflector自动更改Pacman的软件源 - 独孤伶俜

使用reflector自动更改Pacman的软件源

November 18, 2021 on Linux

我们都知道arch-linux的安装过程是需要网络连接的,有时候国内某些时候的网络实在是不怎么样,经常pacstrap的时候5.2kb/s

使用reflector即可帮你解决一切烦恼哦~

在最新的Arch-linux的安装Live镜像中自带了reflector,直接使用即可,在安装好系统之后使用pacman来安装reflector

pacman -S reflector
Shell

在Live环境下联网后直接输入如下指令即可拉取下载速度最快的国内https镜像

reflector --country China --age 120 --sort rate --protocol https --save /etc/pacman.d/mirrorlist
Shell

解释一下参数

--country: 指定国家和区域
--age: 指定最后更新/同步时间,可以过滤掉某些已经停止维护的镜像地址, 单位: 小时
--sort: 指定排序方式, 可选{age,rate,country,score,delay}, 分别为{最后更新, 下载速度, 镜像分数, 延迟}
--protocol: 指定http或https协议
--save: 将结果覆写到文件, 一般都是/etc/pacman.d/mirrorlist, 请提前备份旧的Mirrorlist
--threads: 指定多线程数量,不可大于cpu总线程数量
--list-countries: 列出国家代码和镜像数量

还有一些其他参数, 具体请使用reflector --help查看帮助

Reflector (简体中文) - ArchWiki

[1] : https://wiki.archlinux.org/title/Reflector_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

不要太小看人类了!

上一篇: [Nas折腾记]黑群晖
下一篇: 没有了

添加新评论

当有人回复时接收邮件提醒


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK