You need to know an environment variable when using Pkg_add-r PackageName

Source: Internet
Author: User
Tags ftp ftp site

We know that Pkg_add is used in FreeBSD to install software through the package a command, while-R is that the local does not have package packets, installed automatically downloaded from the Internet. The default sites are generally as follows:

ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.1-release/All/

Such a format, access to foreign servers are generally slower than domestic, especially now when the submarine optical fiber on the occasion of the earthquake, foreign sites are more difficult to access. So it is very necessary to modify this default FTP site, so you need to set Packagesite this environment variable, such as in the CSH shell I have changed:

Bsd#setenv Packagesite ftp://ftp.freebsd.org.cn/pub/FreeBSD/ports/i386/packages-6.1-release/All/

Note that there are different ways to set up environment variables in different shells, which are not prompted for errors when they are run in different shells, but are not effective when set.

SH Shell with:

Export packagesite=ftp://ftp.freebsd.org.cn/pub/freebsd/ports/i386/packages-6.1-release/all/

Okay, now it's much faster to install software downloads through Pkg_add-r!

--------------

Actually it's more convenient to set the packageroot=ftp://ftp.freebsd.org.cn! 2007.3.5

---------------

2008.3.23

These two environment variables are very useful, in general, we use Packageroot on the line.

But in some cases you may want to use packagesite, such as: You upgrade a release kernel to stable, for example, now 7.0 However, there is no package-7.0-stable directory for this package, and now you can only use the existing Packages-7.0-release directory. Since you upgraded to stable, you can use Pkg_add-r when you set the Packageroot variable: ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/i386/ packages-7-stable/latest download files, and actually this directory does not actually exist, so we are hoping from:

Ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/i386/packages-7-release/Latest this directory download. At this time can not use packageroot, but should use the packagesite.

On the FTP inside the specific situation of the directory, you can FTP to specific sites, optimistic about the setting.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.