FreeBSD changing pkg_add package ftp site location

本文介绍了 FreeBSD 下 pkg_add 命令的使用方法,包括如何更改 FTP 站点来下载软件包,以及如何设置环境变量以指定备用的 FTP 位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

FreeBSD changing pkg_add package ftp site location

by nixcraft

pkg_add is a utility for installing software package distributions. It works like Linux apt-get command. It can download package from freebsd ftp site with the remote fetching feature. This will determine the appropriate objformat and release and then fetch and install the package. You can use following syntax:
pkg_add -v -r {package-name}

For example, you can install vim package:

# pkg_add -v -r vim

By default it downloads, the package from ftp.freebsd.org if this site is too busy then you need to use other ftp site location. You can define the environment variable PACKAGEROOT specifies an alternate location for pkg_add to fetch from. The fetch URL is built using this environment variable and the automatic directory logic that pkg_add uses when the -r option is used. For example:

# export PACKAGEROOT=ftp://ftp3.FreeBSD.org
# pkg_add -v -r vim 

You can select FreeBSD ftp mirror sites list. At the writing of this HONG KONG is nearest mirror for me so I will use ftp://ftp.hk.freebsd.org/

# export PACKAGEROOT=ftp://ftp.hk.freebsd.org
# pkg_add -v -r zip

Besides environment variable PACKAGESITE specifies an alternate location for
pkg_add to fetch from. By default, ftp server uses directory path /pub/FreeBSD/ports/i386/packages-VERSION-release/Latest/. This variable subverts the automatic directory logic that pkg_add uses when the -r option is used. Thus it should be a complete URL to the remote package file(s).

 

from : http://www.cyberciti.biz/tips/freebsd-changing-pkg_add-package-ftp-site-location.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值