pacman使用代理服务器

Pacman 可以配置使用外部下载工具,在 /etc/pacman.conf 中有如下2行分别使用 curlwget 来实现下载的配置行:

#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u

取消其中一行注释,然后分别配置 curlwget 的代理,就能够实现 Pacman 通过代理下载。

简单配置proxy

  • 在环境变量中执行:

设置pacman代理的环境变量
#export http_proxy='http://username:password@127.0.0.1:3128'
#export ftp_proxy='http://username:password@127.0.0.1:3128'

export http_proxy='http://192.168.6.200:3128'
export https_proxy='http://192.168.6.200:3128'
export ftp_proxy='http://192.168.6.200:3128'

我已经实践,简单采用上述环境变量就能够让 Pacman 使用代理服务器下载软件包

参考