How to install puppet 7 on Debian 10 Buster

Placeholder image

Jan 24, 2021

Debian is an excellent choice regarding stability, however, there is a price regarding getting newer packages versions. Puppet was released in Nov. 2020 and it brings nice changes like facter 4 usage by default, the release note is available here, but on Debian’s repository, the version available is still 5.5.10! We can check the version using apt-cache show:

$ sudo apt-cache show puppet | grep Version
Version: 5.5.10-4

Therefore, to get a newer version we need to use Puppet repository, Puppetlabs provides a deb repository and the packages are provided using the system version codename (for Debian and Ubuntu). Per example, for Debian 10 the package is puppet7-release-buster.deb, Debian 9 is puppet7-release-stretch.deb. Let’s get the release package and install it:

wget https://apt.puppet.com/puppet7-release-buster.deb
sudo dpkg -i puppet7-release-buster.deb && rm puppet7-release-buster.deb

In the case of supporting multiple versions, we could get the codename first and use it when getting the release package. There are several ways to get the codename, but here is an example:

CODENAME=$(cat /etc/os-release | grep CODENAME | cut -d"=" -f2)
wget https://apt.puppet.com/puppet7-release-$CODENAME.deb
sudo dpkg -i puppet7-release-$CODENAME.deb && rm puppet7-release-$CODENAME.deb

Now we can install the puppet agent using apt:

sudo apt-get update && sudo apt-get install -y puppet-agent

Note that the package name is puppet-agent and not puppet, otherwise, Debian’s repository version will be installed.

Now we have puppet 7 installed and can run it: /opt/puppetlabs/puppet/bin/puppet. It is a bit inconvenient to use the full path, but no worries, puppet adds a file to /etc/profile.d that will be read when a user logs in and we can load it using source /etc/profile, now we can just run puppet command.

Tags