Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone. script


The script is the official D version manager for DMD, GDC and LDC on FreeBSD, Linux and macOS. It provides a convenient way to fetch and install a D compiler without requiring administrative privileges nor external dependencies. Its features include:


Downloading the installer

mkdir -p ~/dlang && wget -O ~/dlang/
Alternatively, the script can be invoked directly:
curl | bash -s

If no arguments are provided, the latest DMD compiler will be installed.

The installer also makes a copy of itself at ~/dlang/


~/dlang/ [<command>] [<args>]

Global options

-p --path
Changes the install location (default ~/dlang)
Activates more verbose output
Displays a help page


~/dlang/ install <compiler>
Download and install a D compiler. By default the latest release of the DMD compiler is selected.


-a --active
Only prints the path to the activate script
Installs the latest version of a compiler
Installs a specific version of a compiler (e.g. dmd-2.071.1, ldc-1.1.0-beta2)
Installs the latest beta version of a compiler
Installs DMD nightly
Installs specific DMD nightly


~/dlang/ dmd
~/dlang/ install dmd
~/dlang/ install dmd-2.071.1
~/dlang/ install ldc-1.1.0-beta2
~/dlang/ install dmd-beta
~/dlang/ install dmd-nightly
Once a compiler is installed, it can be activated for the current session. Run the respective activate script in a shell to use a compiler by default:
source ~/dlang/<installed-compiler>/activate
This will setup the PATH, LIBRARY_PATH, LD_LIBRARY_PATH, DMD, DC, and PS1 environment variables. It's also possible to combine this into one command:
source $(~/dlang/ dmd -a)
The activated compiler can be removed from the current session by restoring the previous environment:
Alternatively, it is also possible to call the compiler binary directly. Note that the exact path varies between the compiler vendors:
Users of the Fish shell can
source ~/dlang/<installed-compiler>/


Uninstall a D compiler.
~/dlang/ uninstall <compiler>


~/dlang/ uninstall dmd
~/dlang/ uninstall dmd-2.071.1
~/dlang/ uninstall ldc-1.1.0-beta2


List all installed D compilers.
~/dlang/ list


Update the installer itself.
~/dlang/ update