How to install and configure FreeBSD without internet access?

After installing FreeBSD we would like to use following commands to install additional packages.

pkg
pkg install nano
pkg install xorg
pkg install mate-desktop mate
pkg install slim

The above commands require an Internet connection to install packages. But how can we install those packages without an Internet connection by using CD/DVD/USB?

Asked By: Madhav Nikam

||

Based upon an open issue in FreeBSD 10.1-RELEASE Errata:

  1. Create a /dist directory, then mount the DVD.

    # mkdir -p /dist
    # mount -t cd9660 /dev/cd0 /dist
    
  2. Make sure REPOS_DIR is correctly pointing to your local repository. For sh(1):

    # export REPOS_DIR=/dist/packages/repos
    

    – or, for csh(1):

    # setenv REPOS_DIR /dist/packages/repos
    
  3. Use pkg(7) to bootstrap pkg(8), then install packages.

    # pkg bootstrap --yes
    # pkg install xorg [...]
    

Limitations of -dvd1.iso files

FreeBSD-13.1-RELEASE-amd64-dvd1.iso does not provide packages for mate, mate-desktop, nano, or slim.

Answered By: mjturner

Just to share my observation on this:

On FreeBSD 11.1, I run $ sudo bsdconfig and go to packages menu item. Then I select the first item which is CD/DVD. Then I select cd0 as my device, but I receive the following error:

No pkg(8) database found!

enter image description here

However, the procedure suggested by @mjturner works fine.

Answered By: user3405291
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.