Monday 5 January 2015

Unable to install puppet on Debian Wheezy - Size mismatch

When I use the following command to install puppet client:
$ wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
$ sudo dpkg -i puppetlabs-release-precise.deb
$ sudo apt-get update
$ sudo apt-get install puppet
I get the following Size mismatch errors:
Get:1 http://cdn.debian.net/debian/ wheezy/main virt-what amd64 1.12-1 [12.9 kB]
Get:2 http://apt.puppetlabs.com/ precise/main facter all 2.3.0-1puppetlabs1 [85.5 kB]
Get:3 http://apt.puppetlabs.com/ precise/main hiera all 1.3.4-1puppetlabs1 [12.9 kB]
Get:4 http://apt.puppetlabs.com/ precise/main puppet-common all 3.7.3-1puppetlabs1 [1654 kB]
Get:5 http://apt.puppetlabs.com/ precise/main puppet all 3.7.3-1puppetlabs1 [9624 B]
Fetched 1775 kB in 0s (3117 kB/s)
Failed to fetch http://apt.puppetlabs.com/pool/precise/main/f/facter/facter_2.3.0-1puppetlabs1_all.deb  Size mismatch
Failed to fetch http://apt.puppetlabs.com/pool/precise/main/h/hiera/hiera_1.3.4-1puppetlabs1_all.deb  Size mismatch
Failed to fetch http://apt.puppetlabs.com/pool/precise/main/p/puppet/puppet-common_3.7.3-1puppetlabs1_all.deb  Size mismatch
Failed to fetch http://apt.puppetlabs.com/pool/precise/main/p/puppet/puppet_3.7.3-1puppetlabs1_all.deb  Size mismatch
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
And no amount of --fix-missing and cache clearing and clean will resolve this issue:
apt-get install puppet --fix-missing
apt-get clean
rm /var/lib/apt/lists/*
rm /var/cache/apt/archives/partial/*
apt-get clean
apt-get update
It turns out that this is an issue in the puppetlabs-release-precise.deb package. So to fix this issue we need to download the SPECIFIC puppetlabs package - in this case for Debian Wheezy:
$ wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb
$ dpkg -i puppetlabs-release-wheezy.deb
$ apt-get update
$ apt-get install puppet
All this then fine.