Using the Ports Collection

本文介绍了三种安装 FreeBSD Ports Collection 的方法:使用 CVSup 协议保持 Ports Collection 更新;利用 Portsnap 工具下载并更新 Ports Collection;通过 sysinstall 从安装介质安装 Ports Collection。这些方法适用于不同场景下的 FreeBSD 用户。

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

Before you can install ports, you must first obtain the Ports Collection--which is essentially a set of Makefiles, patches, and description files placed in /usr/ports.

When installing your FreeBSD system, sysinstall asked if you would like to install the Ports Collection. If you chose no, you can follow these instructions to obtain the ports collection:

CVSup Method

This is a quick method for getting and keeping your copy of the Ports Collection up to date using CVSup protocol. If you want to learn more about CVSup, see Using CVSup.

Note: The implementation of CVSup protocol included with the FreeBSD system is called csup. It first appeared in FreeBSD 6.2. Users of older FreeBSD releases can install it via the net/csup port/package.

Make sure /usr/ports is empty before you run csup for the first time! If you already have the Ports Collection present, obtained from another source, csup will not prune removed patch files.

  1. Run csup:

    # csup -L 2 -h cvsup.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
    

    Change cvsup.FreeBSD.org to a CVSup server near you. See CVSup Mirrors (Section A.6.7) for a complete listing of mirror sites.

    Note: One may want to use his own ports-supfile, for example to avoid the need of passing the CVSup server on the command line.

    1. In this case, as root, copy /usr/share/examples/cvsup/ports-supfile to a new location, such as /root or your home directory.

    2. Edit ports-supfile.

    3. Change CHANGE_THIS.FreeBSD.org to a CVSup server near you. See CVSup Mirrors (Section A.6.7) for a complete listing of mirror sites.

    4. And now to run csup, use the following:

      # csup -L 2 /root/ports-supfile
      
  2. Running the csup(1) command later will download and apply all the recent changes to your Ports Collection, except actually rebuilding the ports for your own system.

Portsnap Method

Portsnap is an alternative system for distributing the Ports Collection. Please refer to Using Portsnap for a detailed description of all Portsnap features.

  1. Download a compressed snapshot of the Ports Collection into /var/db/portsnap. You can disconnect from the Internet after this step, if you wish.

    # portsnap fetch
    
  2. If you are running Portsnap for the first time, extract the snapshot into /usr/ports:

    # portsnap extract
    

    If you already have a populated /usr/ports and you are just updating, run the following command instead:

    # portsnap update
    

Sysinstall Method

This method involves using sysinstall to install the Ports Collection from the installation media. Note that the old copy of Ports Collection from the date of the release will be installed. If you have Internet access, you should always use one of the methods mentioned above.

  1. As root, run sysinstall (/stand/sysinstall in FreeBSD versions older than 5.2) as shown below:

    # sysinstall
    
  2. Scroll down and select Configure, press Enter.

  3. Scroll down and select Distributions, press Enter.

  4. Scroll down to ports, press Space.

  5. Scroll up to Exit, press Enter.

  6. Select your desired installation media, such as CDROM, FTP, and so on.

  7. Scroll up to Exit and press Enter.

  8. Press X to exit sysinstall.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值