I'm provisioning an Ubuntu server with a shell script, for definition a provisioning script should be replicable and idempotent (every time I execute the command it should always act the same). Thus I need to clearly define a package's version. In my case, I want to install cURL 7.22.0, so I've tried:
apt-get install curl=7.22.0
but this doesn't work since the version doesn't exist. So i've checked for specific version in my package's cache with apt-cache madison curl
:
curl | 7.22.0-3ubuntu4.14 | http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
curl | 7.22.0-3ubuntu4.14 | http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
curl | 7.22.0-3ubuntu4 | http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
curl | 7.22.0-3ubuntu4 | http://us.archive.ubuntu.com/ubuntu/ precise/main Sources
curl | 7.22.0-3ubuntu4.14 | http://us.archive.ubuntu.com/ubuntu/ precise-updates/main Sources
curl | 7.22.0-3ubuntu4.14 | http://security.ubuntu.com/ubuntu/ precise-security/main Sources
and I've thought that:
apt-get install curl=7.22.0-3ubuntu4.14
was a smart solution, but alas, after apt-get update
that package disappered and 7.22.0-3ubuntu4.15
come to life, and so the provisioning script doesn't work anymore.
As you can imagine this script is too fragile and completly unusefull. How can I avoid this nasty surprise?