Install newer ninja-build (1.8.2) on Ubuntu 14.04 Trusty

Written by - 4 comments

Published on December 22nd 2017 - Listed in Linux


The developer tool ninja-build can be installed from the official Ubuntu repositories. If you have installed the ninja-build package, you can see it's in version 1.3.4:

/usr/bin/ninja --version
1.3.4

But sometimes developers require (or want) a newer version. With ninja-build that's very easy to do because pre-compiled binaries are ready to download and use.

In this case I installed the current version of ninja-build 1.8.2 on an Ubuntu 14.04 Trusty machine.

Download the current release:

wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip

This file contains the ninja binary. I unzipped it into /usr/local/bin:

sudo unzip ninja-linux.zip -d /usr/local/bin/

Tell Ubuntu to use this new path for the "ninja" command:

sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force
update-alternatives: using /usr/local/bin/ninja to provide /usr/bin/ninja (ninja) in auto mode

Test version output:

/usr/bin/ninja --version
1.8.2

No need to compile from source in this case. Quick and efficient.


Add a comment

Show form to leave a comment

Comments (newest first)

ck from Switzerland wrote on Aug 29th, 2020:

Kitty, this means that your local account needs sudo permissions, correct. At least when you want to use system wide alternatives. For your local environment you don't need it. You could also create an alias in your local shell environment, e.g. ninja="/home/kitty/bin/ninja" or something like that.


ck from Switzerland wrote on Aug 29th, 2020:

Hello Kitty. The sudo commands are already mentioned in the article. So you can basically do copy+paste.


Kitty from wrote on Aug 29th, 2020:

Hi,I followed the instructions without sudo permission. The first 2 lines of command run succcessfully, but the last command failed, the error is "update-alternatives: error: error creating symbolic link '/etc/alternatives/ninja.dpkg-tmp': Permission denied. "
Could you pls tell me how to fix it? Do I have to run these command with sudo perimission? Btw,I'm connectiong remote server,and I have my own environment which is not in usr/local/ file.
Thank you!


Frustrated Ubuntu User from wrote on Jan 9th, 2018:

Thanks, this has saved my ass