Using the Ports Collection

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章