Article

Table of Contents
Theme:
Was this article helpful?
Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles.

Install DUB on Ubuntu 14.04

Last Updated: Sat, Nov 22, 2014
Programming Ubuntu
Archived content

This article is outdated and may not work correctly for current operating systems or software.

In almost every programming language, there is a package manager that makes it easy to build your application along with all your dependencies. DUB, a package manager for D, makes it easy to build your application and also manage dependencies for your project. Dependencies can be found at http://code.dlang.org. This tutorial will show you how to install DUB on Ubuntu 14.04 x64.

Requirements

  • Vultr VPS with Ubuntu 14.04 x64.

  • Basic knowledge of D.

  • Have DMD, LDC, or GDC installed (DMD is recommended).

Download DUB

You will need to download DUB. To do so, run:

wget http://code.dlang.org/files/dub-0.9.22-linux-x86_64.tar.gz

Extract and Install DUB

Extract what you have downloaded and install it by running the following commands:

tar xvf dub-0.9.22-linux-x86_64.tar.gz

mv dub /usr/local/bin

This will install DUB into the system making it available for use in your PATH variable.

Verify Installation

Verify your installation with this command:

dub init test

You should get a message beginning with Successfully created an empty project in and if you do, you can cd into the test directory and run dub, which will build and execute the code located in test/source/app.d. If you get a message saying Edit source/app.d to start your project., then you have successfully installed DUB.

Note: You may want to read the official DUB documents to learn more on how you can setup your dependencies, and your project the way you wish to set it up. This will be extremely useful for multi-deployment when building on different platforms (and possibly in the future for different platforms by cross compiling).

Want to contribute?

You could earn up to $600 by adding new articles.