Image for post
Image for post

Installing Puppet 5

Puppet 5 Agent on Ubuntu Trusty and Xenial

You would think this should be a straight forward task, but no, unfortunately, alas, no, it is not. Forces are at work to stop you from getting Puppet.

Ubuntu has Puppet 3 package available in its official repositories, and they have started on Puppet 4 and Puppet 5 packages, but for whatever reasons never completed them. Thus with Ubuntu you are forever locked to Puppet 3, so don’t, really DON’T, do apt-get install puppet, as that will get you lost.

This may be why Puppet has renamed the package to puppet-agent to avoid Ubuntu’s alternative management style with the puppet package. In any event, reading the docs on Puppet’s website, this won’t be apparent.

Puppet’s docs will instruct you to download an installer that installs the repository entry and public key, so that then you can go install puppet on your own.

Yes, that is correct, the installer DOES NOT INSTALL Puppet. And then afterward, after reading tomes of text, it doesn’t really tell you how to install it.

In any event, here’s how to get Puppet 5 (puppet-agent), Puppet Development Kit (pdk), and the new tool bolt on your system so you can play around with these tools.

Installing Puppet

This process has been tested on both Ubuntu 14.04 Trusty and Ubuntu 16.04 Xenial.

When using a third party repository, you want to install a public signing key to verify that the packages are actually from the folks that made the package, the company Puppet in this case naturally.

sudo apt-key adv \
--keyserver "" \
--recv-keys "EF8D349F"

Now we have to tell Ubuntu about our third party repository and reference it for installing Puppet:

echo "deb $(lsb_release -c -s) puppet5" \
| sudo tee -a /etc/apt/sources.list.d/puppet5.list
sudo apt-get update

You verify that you are pointing to the correct source for puppet-agent, pdk, and bolt.

apt-cache policy puppet-agent bolt pdk

Now we can aptly install the packages from PuppetLab’s repository:

sudo apt-get install -y puppet-agent bolt pdk

Optionally added new tools from Puppet, bolt a simple remote execute tool and pdk(Puppet Dev Kit), a toolset for creating Puppet modules.

So we have the packages installed, and we type puppet and we get the following feedback:

-bash: puppet: command not found


No, We’re not going to take it! Let’s make these puppies available:

After running this fancy schmancy bash snippet, we can check our versions now:

As of April 13, 2018, if none of the programs crash (stack trace), this shows us:

puppet: 5.5.0
facter: 3.11.0
hiera: 3.4.2
mco: 2.12.0
bolt: 0.19.0
pdk: 1.4.1

But a program did stack trace?!?!

Game Over Man!

Well, actually, I had this happen with mco on Ubuntu 16.04. Fortunately, I have a version of ruby 2.4 installed, so I can fix this by gem install stomp. If you don’t have ruby 2.4, well, then get it!

You can install ruby 2.4 easily by using either RVM or rbenv. I even wrote a few articles on these:


Final Thoughts

Let me know if it helps or what you think. I used to work exclusively in Puppet back in 2013 and so wanted to check out the latest. I knew if I had problems, maybe others had problems as well. Drop some comments if this helped you…

Written by

Linux NinjaPants Automation Engineering Mutant — exploring DevOps, Kubernetes, CNI, IAC

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store