Installing DUB
Dub is bundled with the compiler
DUB is being distributed alongside with the major D compilers whenever installing their full packages.
Once you have a D compiler installed, open the terminal and try running dub --version
to see if DUB is installed.
Standalone installation
DUB can be installed separately from the compiler, for example this may be necessary when a package manager is used to install just the compiler or when DUB needs to be updated separately from the compiler to make use of new features.
Tip
Since DUB is bundled with the compiler, you are unlikely to need to install it manually. However for Linux distros you may need to install it separately, which is described below.
From source
First clone the dub repository from git:
If you already have another (perhaps older) DUB version installed, you can simply run
then, the dub executable will be inside the bin
folder.
If you do not have a previous dub version to bootstrap from, use the build.d
script in the repository's folder to build dub:
or directly with dmd or ldc:
Third-party downloads
These links are not maintained by the same people maintaining the official downloads.
Ubuntu/Debian
Using the APT repository also used for the D compilers, you can simply run
Created: September 1, 2023