Appendix A. Obtaining FreeBSD

A.1. CD and DVD Sets

FreeBSD CD and DVD sets are available from several online retailers:

A.2. FTP Sites

The official sources for FreeBSD are available via anonymous FTP from a worldwide set of mirror sites. The site ftp://ftp.FreeBSD.org/pub/FreeBSD/ is available via HTTP and FTP. It is made up of many machines operated by the project cluster administrators and behind GeoDNS to direct users to the closest available mirror.

Additionally, FreeBSD is available via anonymous FTP from the following mirror sites. When obtaining FreeBSD via anonymous FTP, please try to use a nearby site. The mirror sites listed as "Primary Mirror Sites" typically have the entire FreeBSD archive (all the currently available versions for each of the architectures) but faster download speeds are probably available from a site that is in your country or region. The regional sites carry the most recent versions for the most popular architecture(s) but might not carry the entire FreeBSD archive. All sites provide access via anonymous FTP but some sites also provide access via other methods. The access methods available for each site are provided in parentheses after the hostname.

(as of UTC)

Central Servers

Primary Mirror Sites

In case of problems, please contact the hostmaster <mirror-admin@FreeBSD.org> for this domain.

Armenia

In case of problems, please contact the hostmaster <hostmaster@am.FreeBSD.org> for this domain.

Australia

In case of problems, please contact the hostmaster <hostmaster@au.FreeBSD.org> for this domain.

Austria

In case of problems, please contact the hostmaster <hostmaster@at.FreeBSD.org> for this domain.

Brazil

In case of problems, please contact the hostmaster <hostmaster@br.FreeBSD.org> for this domain.

Czech Republic

In case of problems, please contact the hostmaster <hostmaster@cz.FreeBSD.org> for this domain.

Denmark

In case of problems, please contact the hostmaster <hostmaster@dk.FreeBSD.org> for this domain.

Estonia

In case of problems, please contact the hostmaster <hostmaster@ee.FreeBSD.org> for this domain.

Finland

In case of problems, please contact the hostmaster <hostmaster@fi.FreeBSD.org> for this domain.

France

In case of problems, please contact the hostmaster <hostmaster@fr.FreeBSD.org> for this domain.

Germany

In case of problems, please contact the hostmaster <de-bsd-hubs@de.FreeBSD.org> for this domain.

Greece

In case of problems, please contact the hostmaster <hostmaster@gr.FreeBSD.org> for this domain.

Hong Kong

Ireland

In case of problems, please contact the hostmaster <hostmaster@ie.FreeBSD.org> for this domain.

Japan

In case of problems, please contact the hostmaster <hostmaster@ie.FreeBSD.org> for this domain.

Korea

In case of problems, please contact the hostmaster <hostmaster@kr.FreeBSD.org> for this domain.

Latvia

In case of problems, please contact the hostmaster <hostmaster@lv.FreeBSD.org> for this domain.

Lithuania

In case of problems, please contact the hostmaster <hostmaster@lt.FreeBSD.org> for this domain.

Netherlands

In case of problems, please contact the hostmaster <hostmaster@nl.FreeBSD.org> for this domain.

New Zealand

Norway

In case of problems, please contact the hostmaster <hostmaster@no.FreeBSD.org> for this domain.

Poland

In case of problems, please contact the hostmaster <hostmaster@pl.FreeBSD.org> for this domain.

Russia

In case of problems, please contact the hostmaster <hostmaster@ru.FreeBSD.org> for this domain.

Saudi Arabia

In case of problems, please contact the hostmaster <ftpadmin@isu.net.sa> for this domain.

Slovenia

In case of problems, please contact the hostmaster <hostmaster@si.FreeBSD.org> for this domain.

South Africa

In case of problems, please contact the hostmaster <hostmaster@za.FreeBSD.org> for this domain.

Spain

In case of problems, please contact the hostmaster <hostmaster@es.FreeBSD.org> for this domain.

Sweden

In case of problems, please contact the hostmaster <hostmaster@se.FreeBSD.org> for this domain.

Switzerland

In case of problems, please contact the hostmaster <hostmaster@ch.FreeBSD.org> for this domain.

Taiwan

In case of problems, please contact the hostmaster <hostmaster@tw.FreeBSD.org> for this domain.

Ukraine

United Kingdom

In case of problems, please contact the hostmaster <hostmaster@uk.FreeBSD.org> for this domain.

United States of America

In case of problems, please contact the hostmaster <hostmaster@us.FreeBSD.org> for this domain.

A.3. Using Git

A.3.1. Introduction

As of December 2020, FreeBSD uses git as the primary version control system for storing all of FreeBSD’s base source code and documentation.

Git is generally a developer tool. Users may prefer to use freebsd-update (“FreeBSD Update”) to update the FreeBSD base system, and portsnap (“Using the Ports Collection”) to update the FreeBSD Ports Collection. In April 2021, the ports tree will migrate to git.

This section demonstrates how to install Git on a FreeBSD system and use it to create a local copy of a FreeBSD repository. Additional information on the use of Git is included.

A.3.2. Root SSL Certificates

Older FreeBSD systems do not have proper root certificates. Installing security/ca_root_nss on these systems allows Git to verify the identity of HTTPS repository servers. The root SSL certificates can be installed from a port:

# cd /usr/ports/security/ca_root_nss
# make install clean

or as a package:

# pkg install ca_root_nss

A.3.3. Installation

Git can be installed as a package:

# pkg install git

Git can also be installed from the Ports Collection:

# cd /usr/ports/devel/git
# make install clean

A.3.4. Running Git

To fetch a clean copy of the sources into a local directory, use git. This directory of files is called the working tree.

Move or delete an existing destination directory before using git clone for the first time. Cloning over an existing non-git directory will fail.

Git uses URLs to designate a repository, taking the form of protocol://hostname/path. The first component of the path is the FreeBSD repository to access. There are two different repositories, src for the FreeBSD systerm source code, and doc for documentation. In the future a third repository, 'ports' will be available for the FreeBSD ports code. For example, the URL https://git.FreeBSD.org/src.git specifies the main branch of the src repository, using the https protocol.

Table 1. Handy URL Table
ItemGit URL

Web-based repository browser src

https://cgit.freebsd.org/src

Read-only src repo via HTTPS

https://git.freebsd.org/src.git

Read-only src repo via anon-ssh

ssh://anongit@git.freebsd.org/src.git

Read/write src repo for committers

ssh://git@gitrepo.freebsd.org/src.git (*)

Web-based repository browser doc

https://cgit.freebsd.org/doc

Read-only doc repo via HTTPS

https://git.freebsd.org/doc.git

Read-only doc repo via anon-ssh

ssh://anongit@git.freebsd.org/doc.git

Read/write doc repo for committers

ssh://git@gitrepo.freebsd.org/doc.git (*)

  • (*) git is a special user on the repository server which will map your registered ssh key in FreeBSD.org to your identity, no need to change it.

Sometime after the switch to git is complete, gitrepo.freebsd.org will change to simply repo.freebsd.org.

To get started, clone a copy of the FreeBSD repository:

# git clone -o freebsd [ -b branch ] https://git.FreeBSD.org/repo.git wcdir

where:

  • repo is one of the Project repositories: src, ports, or doc.

  • branch depends on the repository used. ports and doc are mostly updated in the main branch, while src maintains the latest version of -CURRENT under main and the respective latest versions of the -STABLE branches under stable/12 (12.x) and stable/13 (13.x).

  • wcdir is the target directory where the contents of the specified branch should be placed. This is usually /usr/ports for ports, /usr/src for src, and /usr/doc for doc.

  • freebsd is the name of the origin to use. By convention in the FreeBSD documentation, the origin is assumed to be freebsd.

This example checks out the main branch of the system sources from the FreeBSD repository using the HTTPS protocol, placing the local working copy in /usr/src. If /usr/src is already present but was not created by git, remember to rename or delete it before the checkout. Git will refuse to do anything otherwise.

# git clone -o freebsd https://git.FreeBSD.org/src.git /usr/src

Because the initial checkout must download the full branch of the remote repository, it can take a while. Please be patient.

After the initial checkout, the local working copy can be updated by running:

# cd wcdir
# git pull --rebase

To update /usr/src created in the example above, use:

# cd /usr/src
# git pull --rebase

The update is much quicker than a checkout, only transferring files that have changed.

There are also external mirrors maintained by project members available, please refer to the "External mirrors" section.

  • ssh://${user}@${url}/${repo}.git can be written as ${user}@${url}:${repo}.git, i.e., following two URLs are both valid for passing to git:

  • ssh://anongit@git.freebsd.org/${repo}.git

  • anongit@git.freebsd.org:${repo}.git

    As well as the read-write repo:
      - `ssh://git@(git)repo.freebsd.org/${repo}.git`
      - `git@(git)repo.freebsd.org:${repo}.git`
  • gitrepo.FreeBSD.org host key fingerprints:

  • ECDSA key fingerprint is SHA256:seWO5D27ySURcx4bknTNKlC1mgai0whP443PAKEvvZA

  • ED25519 key fingerprint is SHA256:lNR6i4BEOaaUhmDHBA1WJsO7H3KtvjE2r5q4sOxtIWo

  • RSA key fingerprint is SHA256:f453CUEFXEJAXlKeEHV+ajJfeEfx9MdKQUD7lIscnQI

  • git.FreeBSD.org host key fingerprints:

  • ECDSA key fingerprint is SHA256:/UlirUAsGiitupxmtsn7f9b7zCWd0vCs4Yo/tpVWP9w

  • ED25519 key fingerprint is SHA256:y1ljKrKMD3lDObRUG3xJ9gXwEIuqnh306tSyFd1tuZE

  • RSA key fingerprint is SHA256:jBe6FQGoH4HjvrIVM23dcnLZk9kmpdezR/CvQzm7rJM

These are also published as SSHFP records in DNS.

A.3.6. Web-based repository browser

The FreeBSD project currently uses cgit as the web-based repository browser: https://cgit.freebsd.org/ The URL of the indivirual repository is at: https://cgit.freebsd.org/${repo}/

A.3.7. For Users

Using git clone and git pull from the official distributed mirrors is recommended. The GeoDNS should direct you to the nearest mirror to you.

A.3.8. For Developers

This section describes the read-write access for committers to push the commits from developers or contributors. For read-only access, please refer to the users section above.

A.3.8.1. Daily use

  • Clone the repository:

% git clone -o freebsd --config remote.freebsd.fetch='+refs/notes/*:refs/notes/*' https://git.freebsd.org/${repo}.git
Then you should have the official mirrors as your remote:
% git remote -v
freebsd  https://git.freebsd.org/${repo}.git (fetch)
freebsd  https://git.freebsd.org/${repo}.git (push)
  • Configure the FreeBSD committer data:

    The commit hook in repo.freebsd.org checks the "Commit" field matches the
    committer's information in FreeBSD.org.  The easiest way to get the suggested
    config is by executing `/usr/local/bin/gen-gitconfig.sh` script on freefall:
% gen-gitconfig.sh
[...]
% git config user.name (your name in gecos)
% git config user.email (your login)@FreeBSD.org
  • Set the push URL:

% git remote set-url --push freebsd git@gitrepo.freebsd.org:${repo}.git
Then you should have separated fetch and push URLs as the most efficient setup:
% git remote -v
freebsd  https://git.freebsd.org/${repo}.git (fetch)
freebsd  git@gitrepo.freebsd.org:${repo}.git (push)
Again, note that `gitrepo.freebsd.org` will be canonicalized to `repo.freebsd.org` in the future.
  • Install commit message template hook:

% fetch https://cgit.freebsd.org/src/plain/tools/tools/git/hooks/prepare-commit-msg -o .git/hooks
% chmod 755 .git/hooks/prepare-commit-msg

A.3.8.2. "admin" branch

The access and mentors files are stored in an orphan branch, internal/admin, in each repository.

Following example is how to check out the internal/admin branch to a local branch named admin:

% git config --add remote.freebsd.fetch '+refs/internal/*:refs/internal/*'
% git fetch
% git checkout -b admin internal/admin

Alternatively, you can add a worktree for the admin branch:

git worktree add -b admin ../${repo}-admin internal/admin

For browsing internal/admin branch on web: https://cgit.freebsd.org/${repo}/log/?h=internal/admin

For pushing, either specify the full refspec:

git push freebsd HEAD:refs/internal/admin

Or set push.default to upstream which will make git push to push the current branch back to its upstream by default, which is more suitable for our workflow:

git config push.default upstream

These internal details may change often.

A.3.9. External mirrors

Those mirrors are not hosted in FreeBSD.org but still maintained by the project members. Users and developers are welcome to pull or browse repositories on those mirrors. The project workflow with those mirrors are still under discussion.

A.3.10. Mailing lists

General usage and questions about git in the FreeBSD project: [freebsd-git](https://lists.freebsd.org/mailman/listinfo/freebsd-git)

Commit messages will be sent to the following mailing lists:

For more information, please refer to the "Commit message lists" section of C.2. "Mailing Lists" in handbook: https://www.freebsd.org/doc/en/books/handbook/eresources-mail.html

A.4. Using Subversion

A.4.1. Introduction

As of December 2020, FreeBSD uses git as the primary version control system for storing all of FreeBSD’s source code and documentation. Changes from the git repo on the stable/11, stable/12 and related releng branches are exported to the subversion repository. This export will continue through the life of these branches. From July 2012 to March 2021, FreeBSD used Subversion as the only version control system for storing all of FreeBSD’s Ports Collection. As of April 2021, FreeBSD uses git as the only version control system for storing all of FreeBSD’s Ports Collection.

Subversion is generally a developer tool. Users may prefer to use freebsd-update (“FreeBSD Update”) to update the FreeBSD base system, and portsnap (“Using the Ports Collection”) to update the FreeBSD Ports Collection. After March 2021, subversion use is only for legacy branches (stable/11 and stable/12).

This section demonstrates how to install Subversion on a FreeBSD system and use it to create a local copy of a FreeBSD repository. Additional information on the use of Subversion is included.

A.4.2. Root SSL Certificates

FreeBSD systems older than 12.x do not have proper root certificates. Installing security/ca_root_nss on these systems allows Subversion to verify the identity of HTTPS repository servers. The root SSL certificates can be installed from a port:

# cd /usr/ports/security/ca_root_nss
# make install clean

or as a package:

# pkg install ca_root_nss

A.4.3. Svnlite

A lightweight version of Subversion is already installed on FreeBSD as svnlite. The port or package version of Subversion is only needed if the Python or Perl API is needed, or if a later version of Subversion is desired.

The only difference from normal Subversion use is that the command name is svnlite.

A.4.4. Installation

If svnlite is unavailable or the full version of Subversion is needed, then it must be installed.

Subversion can be installed from the Ports Collection:

# cd /usr/ports/devel/subversion
# make install clean

Subversion can also be installed as a package:

# pkg install subversion

A.4.5. Running Subversion

To fetch a clean copy of the sources into a local directory, use svn. The files in this directory are called a local working copy.

Move or delete an existing destination directory before using checkout for the first time. Checkout over an existing non-svn directory can cause conflicts between the existing files and those brought in from the repository.

Subversion uses URLs to designate a repository, taking the form of protocol://hostname/path. The first component of the path is the FreeBSD repository to access. There are three different repositories, base for the FreeBSD base system source code, ports for the Ports Collection, and doc for documentation. For example, the URL https://svn.FreeBSD.org/base/head/ specifies the main branch of the ports repository, using the https protocol.

A checkout from a given repository is performed with a command like this:

# svn checkout https://svn.FreeBSD.org/repository/branch lwcdir

where:

  • repository is one of the Project repositories: base, ports, or doc.

  • branch depends on the repository used. ports and doc are mostly updated in the head branch, while base maintains the latest version of -CURRENT under head and the respective latest versions of the -STABLE branches under stable/9 (9.x) and stable/10 (10.x).

  • lwcdir is the target directory where the contents of the specified branch should be placed. This is usually /usr/ports for ports, /usr/src for base, and /usr/doc for doc.

This example checks out the Source Tree from the FreeBSD repository using the HTTPS protocol, placing the local working copy in /usr/src. If /usr/src is already present but was not created by svn, remember to rename or delete it before the checkout.

# svn checkout https://svn.FreeBSD.org/base/head /usr/src

Because the initial checkout must download the full branch of the remote repository, it can take a while. Please be patient.

After the initial checkout, the local working copy can be updated by running:

# svn update lwcdir

To update /usr/ports created in the example above, use:

# svn update /usr/src

The update is much quicker than a checkout, only transferring files that have changed.

An alternate way of updating the local working copy after checkout is provided by the Makefile in the /usr/ports, /usr/src, and /usr/doc directories. Set SVN_UPDATE and use the update target. For example, to update /usr/src:

# cd /usr/src
# make update SVN_UPDATE=yes

A.4.6. Git Mirror Sites

The FreeBSD Git repository is:

https://git.freebsd.org/

This is a publicly accessible mirror network that uses GeoDNS to select an appropriate back end server. To view the FreeBSD Subversion repositories through a browser, use https://cgit.freebsd.org.

A.4.7. Subversion Mirror Sites

The FreeBSD Subversion repository is:

svn.FreeBSD.org

This is a publicly accessible mirror network that uses GeoDNS to select an appropriate back end server. To view the FreeBSD Subversion repositories through a browser, use https://svnweb.FreeBSD.org/.

HTTPS is the preferred protocol, but the security/ca_root_nss package will need to be installed in order to automatically validate certificates.

A.4.8. For More Information

For other information about using Subversion, please see the "Subversion Book", titled Version Control with Subversion, or the Subversion Documentation.

A.5. Using rsync

These sites make FreeBSD available through the rsync protocol. The rsync utility transfers only the differences between two sets of files. This is useful for mirror sites of the FreeBSD FTP server. The rsync suite is available for many operating systems, on FreeBSD, see the net/rsync port or use the package.

Czech Republic

rsync://ftp.cz.FreeBSD.org/

Available collections:

  • ftp: A partial mirror of the FreeBSD FTP server.

  • FreeBSD: A full mirror of the FreeBSD FTP server.

Netherlands

rsync://ftp.nl.FreeBSD.org/

Available collections:

  • FreeBSD: A full mirror of the FreeBSD FTP server.

Russia

rsync://ftp.mtu.ru/

Available collections:

  • FreeBSD: A full mirror of the FreeBSD FTP server.

  • FreeBSD-Archive: The mirror of FreeBSD Archive FTP server.

Sweden

rsync://ftp4.se.freebsd.org/

Available collections:

  • FreeBSD: A full mirror of the FreeBSD FTP server.

Taiwan

rsync://ftp.tw.FreeBSD.org/

rsync://ftp2.tw.FreeBSD.org/

rsync://ftp6.tw.FreeBSD.org/

Available collections:

  • FreeBSD: A full mirror of the FreeBSD FTP server.

United Kingdom

rsync://rsync.mirrorservice.org/

Available collections:

  • ftp.freebsd.org: A full mirror of the FreeBSD FTP server.

United States of America

rsync://ftp-master.FreeBSD.org/

This server may only be used by FreeBSD primary mirror sites.

Available collections:

  • FreeBSD: The master archive of the FreeBSD FTP server.

  • acl: The FreeBSD master ACL list.

    rsync://ftp13.FreeBSD.org/

    Available collections:

  • FreeBSD: A full mirror of the FreeBSD FTP server.


All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.