免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1511 | 回复: 3
打印 上一主题 下一主题

关于Ports 的笔记 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-12-27 14:33 |只看该作者 |倒序浏览
About one year ago, in order to study FreeBSD systematically, I read through the FreeBSD Handbook and summarized the material for better unstanding. By doing this, I found the work did help me a lot, as every time when I wrote something into the notebook, I had to undertand the logic and organized the materials in a way that I understood.  However, the chapter I am posting here is the only chapter that I typed on my computer. All other chapters were written by hand.
Now, I'd like to post it here to show you the way I learnt. Any mistakes remain on my own and all corrections are warmly welcome.

Chapter 4 Installing Applications: Packages and Ports (1)


1.  Overview of Software Installation
Two ways to install software in FreeBSD system: Packages and Ports.

Packages:
The steps of installing a package:
1.        Downloading
2.        Unpacking
3.        Patching
4.        Compiling
5.        installing

Ports:
A FreeBSD port for an application is a collection of files designed to automate the process of compiling an application from source code.


2.  Benefits of Package and Ports
Package Benefits
1.        Size is smaller than source code
2.        Not require additional compilation (time-consuming on a slow system)
3.        Not require any understanding of the process involved in compiling software on FreeBSD

Ports Benefits
1.        Tweak the compilation options vs. Conservative options (it could generate code that is specific to a system)
2.        Some applications have compile time options relating to what they can and cannot do
3.        Some software is distributed by source code to avoid licensing.
4.        Some people don't trust binary distributions.
5.        If you have local patches, you will need the source in order to apply them.


3.  Finding Your Application
When you decide to install an application, you must know what the application is called. There are a number of ways to find it out:
1.        www.FreeBSD.org/ports. An up-to-date searchable list of all the available applications.
2.        www.FreshPorts.org. It tracks changes to the applications in the ports tree as they happen.
3.        www.freshmeat.net. Find an application without knowing the name.
4.        When you know the exact name of the port and want to find out which category it is in, you can use whereis file command.
5.        Use the Ports Collection’s built-in search mechanism. Within the /usr/ports, run make search name=program-name or make search key=string where string is some text to search for (case-insensitive).



4.  Using the Packages System

4.1 Installing a Package – download a package manually and install it locally:
1.        Connect to the server:               
                #  ftp –a ftp2.FreeBSD.org
2.        Change to the right directory                                                       
                #  cd /pub/FreeBSD/ports/packages/sysutils/
3.        Download the file                                                                       
                #  get lsof-4.56.4.tgz
4.        Disconnect the connection and install the package               
                ftp>  exit
               #  pkg_add lsof-4.56.4.tgz
If you don't have a source of local packages (such as a FreeBSD CD-ROM set) then it will probable be easier to use the –r option to pkg_add. This will cause the utility to automatically determine the correct object formal and release and then fetch and install the package from an FTP site.
              # pkg_add –r lsof


4.2  Managing Packages
pkg_info
A utility that lists and describes the various packages installed.
       
pkg_version
Summarizes the versions of all installed packages. It compares the package version to the current version found in the ports tree. The meanings of the following symbols are.
=        Installed package matches the one found in the local ports tree.
<        The installed version is older than the one available in the ports tree
>        The installed version is newer than the one available in the ports tree.
?        The installed package cannot be found in the ports index.
*        There are multiple versions of the package.

pkg_delete
        Remove a previously installed software package.
        #   pkg_delete xchat-1.7.1


4.3  Miscellaneous
All packages information is stored within the /var/db/pkg directory. The installed file list and descriptions of each package can be found within files in this directory.

论坛徽章:
0
2 [报告]
发表于 2005-12-28 10:40 |只看该作者
good!

论坛徽章:
0
3 [报告]
发表于 2005-12-28 12:59 |只看该作者
顶一下,灌水即是王道!

论坛徽章:
0
4 [报告]
发表于 2005-12-28 13:07 |只看该作者
原帖由 hongzjx 于 2005-12-28 12:59 发表
顶一下,灌水即是王道!

一起...嘿嘿
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP