Translation

(itstool) path: listitem/indexterm
<primary>FreshPorts</primary>
29/290
Context English Chinese (Simplified) (zh_CN) State
Packages do not require compilation time. For large applications, such as <application>Mozilla</application>, <application>KDE</application>, or <application>GNOME</application>, this can be important on a slow system. Package 不需要编译时间。对于大型应用程序,如<application>Mozilla</application>、<application>KDE</application>、或<application>GNOME</application>,这对度较慢的系统上非常重要。
Packages do not require any understanding of the process involved in compiling software on FreeBSD. Package 不需要您知道如何在 FreeBSD 上编译软件的详细过程。
Port Benefits Port 优势
Packages are normally compiled with conservative options because they have to run on the maximum number of systems. By compiling from the port, one can change the compilation options. package 通常使用较为保守的编译选项,因为它必须适配大多是系统。从 Port 编译,可以更改编译选项。
Some applications have compile-time options relating to which features are installed. For example, <application>Apache</application> can be configured with a wide variety of different built-in options. 一些软件包已经把与它们相关的能做和不能做的事情的选项都编译进去了。 例如,<application>Apache</application> 可能就配置了很多的选项。 从 Ports 中安装时,您不一定要接受默认的选项,可以自己来设置。
In some cases, multiple packages will exist for the same application to specify certain settings. For example, <application>Ghostscript</application> is available as a <filename>ghostscript</filename> package and a <filename>ghostscript-nox11</filename> package, depending on whether or not <application>Xorg</application> is installed. Creating multiple packages rapidly becomes impossible if an application has more than one or two different compile-time options. 在一些例子中,一个软件有不同的配置存在多个package。 例如, <application>Ghostscript</application>存在 <filename>ghostscript</filename> package 和 <filename>ghostscript-nox11</filename> package 两个配置 package, 这取决于您是否安装了X11 服务器。这样的调整对 package 是可能的, 但如果一个应用程序有超过一个或两个不同的编译时间选项时, 就不行了。
The licensing conditions of some software forbid binary distribution. Such software must be distributed as source code which must be compiled by the end-user. 一些软件的许可条件禁止采用二进制形式发行。 它们必须带上源代码。
Some people do not trust binary distributions or prefer to read through source code in order to look for potential problems. 一些人不信任二进制发行形式。 至少有了源代码, (理论上) 可以亲自阅读它,寻找潜在的问题。
Source code is needed in order to apply custom patches. 如果您要自己对软件打补丁,您就需要有源代码。
To keep track of updated ports, subscribe to the <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-ports">FreeBSD ports mailing list</link> and the <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-ports-bugs">FreeBSD ports bugs mailing list</link>. 保持更新 ports, 订阅邮件列表 <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-ports">FreeBSD ports 邮件列表</link> 和递交错误报告 <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-ports-bugs">FreeBSD ports bugs 邮件列表</link>。
Before installing any application, check <link xlink:href="https://vuxml.freebsd.org/"/> for security issues related to the application or type <command>pkg audit -F</command> to check all installed applications for known vulnerabilities. 安装任何应用程序之前, 应首先查看 <link xlink:href="https://vuxml.freebsd.org/"/>或使用<command>pkg audit -F</command>检查是否有关于您所安装的应用程序的安全问题报告。
The remainder of this chapter explains how to use packages and ports to install and manage third-party software on FreeBSD. 这章的其余部分将介绍在 FreeBSD 上如何使用 packages 和 ports 来安装和管理第三方软件。
Finding Software 寻找您要的应用程序
FreeBSD's list of available applications is growing all the time. There are a number of ways to find software to install: FreeBSD中可用的应用程序正在不断地增长着。有许多方法可以找到您所需要的软件:
The FreeBSD web site maintains an up-to-date searchable list of all the available applications, at <link xlink:href="@@URL_RELPREFIX@@/ports/index.html">https://www.FreeBSD.org/ports/</link>. The ports can be searched by application name or by software category. FreeBSD站点上有一个可以搜索到的当前所有可用的应用程序列表,在 <link xlink:href="@@URL_RELPREFIX@@/ports/index.html">http://www.FreeBSD.org/ports/</link>。 它分很多种类,您既可以通过程序的名称来搜索(如果您知道名字),也可以在分类中列出所有可用的应用程序。
<primary>FreshPorts</primary> <primary>FreshPorts</primary>
Dan Langille maintains <link xlink:href="http://www.FreshPorts.org/">FreshPorts.org</link> which provides a comprehensive search utility and also tracks changes to the applications in the Ports Collection. Registered users can create a customized watch list in order to receive an automated email when their watched ports are updated. Dan Langille 维护着网站 FreshPorts,在 <uri xlink:href="http://www.FreshPorts.org/">http://www.FreshPorts.org/</uri>。 FreshPort时刻 <quote>追踪</quote> 着在 ports 中应用程序的变化。当有任何程序被升级时,他们就会发 email 提醒您。
<primary>SourceForge</primary> <primary>SourceForge</primary>
If finding a particular application becomes challenging, try searching a site like <link xlink:href="http://www.sourceforge.net/">SourceForge.net</link> or <link xlink:href="http://www.github.com/">GitHub.com</link> then check back at the <link xlink:href="@@URL_RELPREFIX@@/ports/index.html">FreeBSD site</link> to see if the application has been ported. 如果找到特定的应用程序比较困难,请尝试在 <link xlink:href="http://www.sourceforge.net/">SourceForge.net</link>或<link xlink:href="http://www.github.com/">GitHub.com</link>上搜索,然后在<link xlink:href="@@URL_RELPREFIX@@/ports/index.html">FreeBSD site</link>查看应用程序是否已被移植。
<primary>pkg</primary> <secondary>search</secondary> <primary>pkg</primary> <secondary>搜索</secondary>
To search the binary package repository for an application: 使用下列命令搜索 pkg 中的软件包:
<prompt>#</prompt> <userinput>pkg search <replaceable>subversion</replaceable></userinput>
git-subversion-<replaceable>1.9.2</replaceable>
java-subversion-<replaceable>1.8.8_2</replaceable>
p5-subversion-<replaceable>1.8.8_2</replaceable>
py27-hgsubversion-<replaceable>1.6</replaceable>
py27-subversion-<replaceable>1.8.8_2</replaceable>
ruby-subversion-<replaceable>1.8.8_2</replaceable>
subversion-<replaceable>1.8.8_2</replaceable>
subversion-book-<replaceable>4515</replaceable>
subversion-static-<replaceable>1.8.8_2</replaceable>
subversion16-<replaceable>1.6.23_4</replaceable>
subversion17-<replaceable>1.7.16_2</replaceable>
<prompt>#</prompt> <userinput>pkg search <replaceable>subversion</replaceable></userinput>
git-subversion-<replaceable>1.9.2</replaceable>
java-subversion-<replaceable>1.8.8_2</replaceable>
p5-subversion-<replaceable>1.8.8_2</replaceable>
py27-hgsubversion-<replaceable>1.6</replaceable>
py27-subversion-<replaceable>1.8.8_2</replaceable>
ruby-subversion-<replaceable>1.8.8_2</replaceable>
subversion-<replaceable>1.8.8_2</replaceable>
subversion-book-<replaceable>4515</replaceable>
subversion-static-<replaceable>1.8.8_2</replaceable>
subversion16-<replaceable>1.6.23_4</replaceable>
subversion17-<replaceable>1.7.16_2</replaceable>
Package names include the version number and, in the case of ports based on python, the version number of the version of python the package was built with. Some ports also have multiple versions available. In the case of <application>Subversion</application>, there are different versions available, as well as different compile options. In this case, the statically linked version of <application>Subversion</application>. When indicating which package to install, it is best to specify the application by the port origin, which is the path in the ports tree. Repeat the <command>pkg search</command> with <option>-o</option> to list the origin of each package: 软件包名字中带有版本号。如果这个软件使用 Python 写的,包名中还会包含软件使用的 Python 版本号。一些软件可能会有很多个版本。以<application>Subversion</application>为例,就有许多不同的版本,还有不同的编译参数。在本例中,静态链接的<application>Subversion</application>版本。指示要安装哪个包时,最好按 Port 源指定应用程序,Port 源是 Port 树中的路径。使用 <command>pkg search -o</command> 列出每个包的来源:
<prompt>#</prompt> <userinput>pkg search -o <replaceable>subversion</replaceable></userinput>
devel/git-subversion
java/java-subversion
devel/p5-subversion
devel/py-hgsubversion
devel/py-subversion
devel/ruby-subversion
devel/subversion16
devel/subversion17
devel/subversion
devel/subversion-book
devel/subversion-static
<prompt>#</prompt> <userinput>pkg search -o <replaceable>subversion</replaceable></userinput>
devel/git-subversion
java/java-subversion
devel/p5-subversion
devel/py-hgsubversion
devel/py-subversion
devel/ruby-subversion
devel/subversion16
devel/subversion17
devel/subversion
devel/subversion-book
devel/subversion-static
Searching by shell globs, regular expressions, exact match, by description, or any other field in the repository database is also supported by <command>pkg search</command>. After installing <package>ports-mgmt/pkg</package> or <package>ports-mgmt/pkg-devel</package>, see <citerefentry><refentrytitle>pkg-search</refentrytitle><manvolnum>8</manvolnum></citerefentry> for more details. <command>pkg search</command>支持使用 Shell 通配符(globs)、正则表达式、描述或文件库中的其他其他内容。在安装<package>ports-mgmt/pkg</package>或<package>ports-mgmt/pkg-devel</package>之后,可参考<citerefentry><refentrytitle>pkg-search</refentrytitle><manvolnum>8</manvolnum></citerefentry> 以取得更多详细信息。
If the Ports Collection is already installed, there are several methods to query the local version of the ports tree. To find out which category a port is in, type <command>whereis <replaceable>file</replaceable></command>, where <replaceable>file</replaceable> is the program to be installed: 若 Port 软件集已安装,有数个方法可以查询 Port 树中的本地版本。要找到 Port 所在的分类,可输入<command>whereis <replaceable>file</replaceable></command>,其中<replaceable>file</replaceable>是要安装的程序:
<prompt>#</prompt> <userinput>whereis lsof</userinput>
lsof: /usr/ports/sysutils/lsof
<prompt>#</prompt> <userinput>whereis lsof</userinput>
lsof: /usr/ports/sysutils/lsof
Alternately, an <citerefentry><refentrytitle>echo</refentrytitle><manvolnum>1</manvolnum></citerefentry> statement can be used: 或使用<citerefentry><refentrytitle>echo</refentrytitle><manvolnum>1</manvolnum></citerefentry>:
<prompt>#</prompt> <userinput>echo /usr/ports/*/*lsof*</userinput>
/usr/ports/sysutils/lsof
<prompt>#</prompt> <userinput>echo /usr/ports/*/*lsof*</userinput>
/usr/ports/sysutils/lsof
Note that this will also return any matched files downloaded into the <filename>/usr/ports/distfiles</filename> directory. 请注意,这也会显示已下载至<filename>/usr/ports/distfiles</filename>目录中任何已符合条件的文件。
Another way to find software is by using the Ports Collection's built-in search mechanism. To use the search feature, <application>cd</application> to <filename>/usr/ports</filename> then run <command>make search name=program-name</command> where <replaceable>program-name</replaceable> is the name of the software. For example, to search for <command>lsof</command>: 另一个方法是使用 Port 套件集内置的搜寻机制来找软件。要使用搜寻的功能需先<application>cd</application>到<filename>/usr/ports</filename>然后执行<command>make search name=program-name</command>,其中<replaceable >program-name</replaceable>代表软件的名称。举例搜索<command>lsof</command>:

Loading…

No matching activity found.

Browse all component changes

Things to check

Unchanged translation

Source and translation are identical

Reset

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: listitem/indexterm
Source string location
book.translate.xml:9357
String age
a year ago
Source string age
a year ago
Translation file
books/zh_CN/handbook.po, string 1550