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

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?


I'm not sure what release you're using, but I'm assuming 10.1, currently the latest. The installation process is described in the 10.1-RELEASE errata:

  1. Create a /dist directory and mount the DVD.

    # mkdir -p /dist
    # mount -t cd9660 /dev/cd0 /dist
  2. Make sure REPOS_DIR is correctly pointing to your local repository.

    # export REPOS_DIR=/dist/packages/repos

    or for csh:

    # setenv REPOS_DIR /dist/packages/repos
  3. Bootstrap pkg and install packages.

    # pkg bootstrap
    # pkg install xorg-server xorg gnome2 [...]
  • FreeBSD-10.1-RELEASE-i386-dvd1 i use it.... – Madhav Nikam Jul 13 '15 at 14:13
  • mount -t cd9660 /dev/cd0 /dist that not show anything and export REPOS_DIR=/dist/packages/repos it shows error :- E: export command not found. – Madhav Nikam Jul 13 '15 at 14:43
  • @MadhavNikam Is the DVD in the machine? You need to insert it before attempting to mount it. If the export failed, you must be using csh, so use setenv instead. – mjturner Jul 13 '15 at 14:46
  • DVD is in machine. csh worked. now again one think ;;; pkg install xorg-server xorg gnome2 after that one msg shows:- The process will require 2 GB more space. 511 MB to be downloaded. It still require internet? – Madhav Nikam Jul 13 '15 at 14:48
  • 2
    @MadhavNikam As that's separate from your original question, please create a new question. – mjturner Jul 13 '15 at 18:43

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.