Home  /  Resources & support  /  FAQs  /  Install Stata from a terminal

How to install Stata from a terminal

Title   Install Stata from a terminal
Author Chinh Nguyen, StataCorp

Stata's installer allows you to install Stata/MP, Stata/SE, or Stata/BE from a terminal.

  1. Mount the Stata disk image. For instructions on how to mount the disk image from a terminal, see Mounting a Stata disk image (DMG) from a terminal or mount the disk image from the Finder.
  2. Create a plain text file named mychoice.xml and include the following text:
          <array>
                  <string>StataMP</string>
          </array>
  3. If you wish to install Stata/SE, then replace StataMP with StataSE:
          StataMP:     Stata/MP
          StataSE:     Stata/SE
          StataBE:     Stata/BE
  4. Enter the following command with the path to the Stata installer package:
          sudo installer -package /Volumes/Stata/Install\ Stata.pkg -applyChoiceChangesXML mychoice.xml -target / 

Mounting a Stata disk image (DMG) from a terminal

From a terminal, use the following command to mount the disk image:

      hdiutil attach /path/to/Stata18.dmg 

When the disk image is mounted, a message will display something like this:

      /dev/disk7              GUID_partition_scheme
      /dev/disk7s1            Apple_HFS                       /Volumes/Stata

Take note of the entry with the mounted disk image named Stata. You will use the entry's /dev node path to unmount the disk image (/dev/disk7s1).

Unmounting a disk image (DMG) from a terminal

Using the device name of the mounted disk image, use the following command to unmount the disk image:

      hdiutil detach /dev/disk7s1